やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

組込ライブラリ(RubyVM)

 Rubyの内部情報。

成果物

情報源

RubyVM

Ruby の 内部情報へのアクセス手段を提供するクラスです。デバッグ用、プロトタイピング用、研究用などのとても限定された用途向けです。一般ユーザーは使うべきではありません。

定数 概要
DEFAULT_PARAMS デフォルトパラメータを返す
INSTRUCTION_NAMES 命令シーケンスの名前一覧を返す
OPTS ビルドオプション一覧を返す
p RubyVM::DEFAULT_PARAMS
p RubyVM::INSTRUCTION_NAMES
p RubyVM::OPTS
{:thread_vm_stack_size=>524288, :thread_machine_stack_size=>524288, :fiber_vm_stack_size=>65536, :fiber_machine_stack_size=>262144}
["nop", "getlocal", "setlocal", "getblockparam", "setblockparam", "getblockparamproxy", "getspecial", "setspecial", "getinstancevariable", "setinstancevariable", "getclassvariable", "setclassvariable", "getconstant", "setconstant", "getglobal", "setglobal", "putnil", "putself", "putobject", "putspecialobject", "putstring", "concatstrings", "tostring", "toregexp", "intern", "newarray", "newarraykwsplat", "duparray", "duphash", "expandarray", "concatarray", "splatarray", "newhash", "newrange", "pop", "dup", "dupn", "swap", "reverse", "topn", "setn", "adjuststack", "defined", "checkmatch", "checkkeyword", "checktype", "defineclass", "definemethod", "definesmethod", "send", "opt_send_without_block", "opt_str_freeze", "opt_nil_p", "opt_str_uminus", "opt_newarray_max", "opt_newarray_min", "invokesuper", "invokeblock", "leave", "throw", "jump", "branchif", "branchunless", "branchnil", "opt_getinlinecache", "opt_setinlinecache", "once", "opt_case_dispatch", "opt_plus", "opt_minus", "opt_mult", "opt_div", "opt_mod", "opt_eq", "opt_neq", "opt_lt", "opt_le", "opt_gt", "opt_ge", "opt_ltlt", "opt_and", "opt_or", "opt_aref", "opt_aset", "opt_aset_with", "opt_aref_with", "opt_length", "opt_size", "opt_empty_p", "opt_succ", "opt_not", "opt_regexpmatch2", "invokebuiltin", "opt_invokebuiltin_delegate", "opt_invokebuiltin_delegate_leave", "getlocal_WC_0", "getlocal_WC_1", "setlocal_WC_0", "setlocal_WC_1", "putobject_INT2FIX_0_", "putobject_INT2FIX_1_", "trace_nop", "trace_getlocal", "trace_setlocal", "trace_getblockparam", "trace_setblockparam", "trace_getblockparamproxy", "trace_getspecial", "trace_setspecial", "trace_getinstancevariable", "trace_setinstancevariable", "trace_getclassvariable", "trace_setclassvariable", "trace_getconstant", "trace_setconstant", "trace_getglobal", "trace_setglobal", "trace_putnil", "trace_putself", "trace_putobject", "trace_putspecialobject", "trace_putstring", "trace_concatstrings", "trace_tostring", "trace_toregexp", "trace_intern", "trace_newarray", "trace_newarraykwsplat", "trace_duparray", "trace_duphash", "trace_expandarray", "trace_concatarray", "trace_splatarray", "trace_newhash", "trace_newrange", "trace_pop", "trace_dup", "trace_dupn", "trace_swap", "trace_reverse", "trace_topn", "trace_setn", "trace_adjuststack", "trace_defined", "trace_checkmatch", "trace_checkkeyword", "trace_checktype", "trace_defineclass", "trace_definemethod", "trace_definesmethod", "trace_send", "trace_opt_send_without_block", "trace_opt_str_freeze", "trace_opt_nil_p", "trace_opt_str_uminus", "trace_opt_newarray_max", "trace_opt_newarray_min", "trace_invokesuper", "trace_invokeblock", "trace_leave", "trace_throw", "trace_jump", "trace_branchif", "trace_branchunless", "trace_branchnil", "trace_opt_getinlinecache", "trace_opt_setinlinecache", "trace_once", "trace_opt_case_dispatch", "trace_opt_plus", "trace_opt_minus", "trace_opt_mult", "trace_opt_div", "trace_opt_mod", "trace_opt_eq", "trace_opt_neq", "trace_opt_lt", "trace_opt_le", "trace_opt_gt", "trace_opt_ge", "trace_opt_ltlt", "trace_opt_and", "trace_opt_or", "trace_opt_aref", "trace_opt_aset", "trace_opt_aset_with", "trace_opt_aref_with", "trace_opt_length", "trace_opt_size", "trace_opt_empty_p", "trace_opt_succ", "trace_opt_not", "trace_opt_regexpmatch2", "trace_invokebuiltin", "trace_opt_invokebuiltin_delegate", "trace_opt_invokebuiltin_delegate_leave", "trace_getlocal_WC_0", "trace_getlocal_WC_1", "trace_setlocal_WC_0", "trace_setlocal_WC_1", "trace_putobject_INT2FIX_0_", "trace_putobject_INT2FIX_1_"]
["direct threaded code", "operands unification", "inline method cache"]

所感

 これは知らなくていいや。

対象環境

$ uname -a
Linux raspberrypi 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux