るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.105秒)
トップページ > クエリ:l[x] > クエリ:disassemble[x]

別のキーワード

  1. matrix l
  2. _builtin $-l
  3. kernel $-l
  4. lupdecomposition l
  5. l matrix

検索結果

RubyVM::InstructionSequence#disassemble -> String (18201.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

puts RubyVM::InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1...
...( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave

@see RubyVM::InstructionSequence.disasm...

RubyVM::InstructionSequence.disassemble(body) -> String (18201.0)

引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。

...InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
l
ocal table (size: 2, argc: 0...
...[opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 dup
0009 setlocal num, 0
0012 leave

例2:Method オブジェク...
...トを指定した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

puts RubyVM::InstructionSequence.disasm(method(:hello))

出力:

== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8...