disasm 2

iseq.disasm â str
Instance Public methods

Returns the instruction sequence as a String in human readable form.

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

Produces:

1
2
3
4
5
6
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace            1                                               (   1)
0002 putobject        1
0004 putobject        2
0006 opt_plus         <ic:1>
0008 leave
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.