るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.316秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

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

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

...た場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)

出力:

==
disasm: <RubyVM::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: 0...
...rb
def hello
puts "hello, world"
end

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

出力:

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

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

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

...た場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::InstructionSequence.disasm(p)

出力:

==
disasm: <RubyVM::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: 0...
...rb
def hello
puts "hello, world"
end

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

出力:

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