Created
March 20, 2015 14:07
-
-
Save dronov/aa5c60780824b364c14c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):009:0> code = <<-END | |
irb(main):010:0" puts 2+2 | |
irb(main):011:0" END | |
=> "puts 2+2\n" | |
irb(main):012:0> puts RubyVM::InstructionSequence.compile(code).disasm | |
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== | |
0000 trace 1 ( 1) | |
0002 putself | |
0003 putobject 2 | |
0005 putobject 2 | |
0007 opt_plus <callinfo!mid:+, argc:1, ARGS_SKIP> | |
0009 opt_send_simple <callinfo!mid:puts, argc:1, FCALL|ARGS_SKIP> | |
0011 leave | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment