Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

RubyVM::InstructionSequence#disassemble

iseq.disassemble → str

Alias of #disasm

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

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

Produces:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace            1                                               (   1)
0002 putobject        1
0004 putobject        2
0006 opt_plus         <ic:1>
0008 leave
See also #disasm .disassemble #each_child #base_label also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0