るりまサーチ

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

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

ライブラリ

検索結果

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

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

...9 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>============...
...2 trace 1 ( 2)
0004 putself
0005 putstring "hello, world"
0007 send :puts, 1, nil, 8, <ic:0>
0013 trace 16 ( 3)
0015 leave...

RubyVM::InstructionSequence.disasm(body) -> String (13.0)

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

...9 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>============...
...2 trace 1 ( 2)
0004 putself
0005 putstring "hello, world"
0007 send :puts, 1, nil, 8, <ic:0>
0013 trace 16 ( 3)
0015 leave...