allomov
7/24/2013 - 7:00 PM

gistfile1.txt

irb(main):004:0> x = RubyVM::InstructionSequence.new('puts "hello #{foo}"')
=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
irb(main):005:0> puts x.disasm
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace            1                                               (   1)
0002 putself          
0003 putobject        "hello "
0005 putself          
0006 opt_send_simple  <callinfo!mid:foo, argc:0, FCALL|VCALL|ARGS_SKIP>
0008 tostring         
0009 concatstrings    2
0011 opt_send_simple  <callinfo!mid:puts, argc:1, FCALL|ARGS_SKIP>
0013 leave            
=> nil
irb(main):006:0>