Interactive YARV Compiler

Let's see how this Ruby script is compiled into an instruction sequence!


Result

No optimization:

["YARVInstructionSequence/SimpleDataFormat",
 1,
 2,
 1,
 {:arg_size=>0, :local_size=>1, :stack_max=>2},
 "<compiled>",
 "<compiled>",
 nil,
 1,
 :top,
 [],
 0,
 [],
 [1, [:putobject, 1], [:putobject, 2], [:send, :+, 1, nil, 0, 0], [:leave]]]
== disasm: @>==========
0000 putobject        1                                               (   1)
0002 putobject        2
0004 send             :+, 1, nil, 0, 
0010 leave            

With optimization:

["YARVInstructionSequence/SimpleDataFormat",
 1,
 2,
 1,
 {:arg_size=>0, :local_size=>1, :stack_max=>2},
 "<compiled>",
 "<compiled>",
 nil,
 1,
 :top,
 [],
 0,
 [],
 [1, [:trace, 1], [:putobject, 1], [:putobject, 2], [:opt_plus, 1], [:leave]]]
== disasm: @>==========
0000 trace            1                                               (   1)
0002 putobject        1
0004 putobject        2
0006 opt_plus         
0008 leave