Last active
November 17, 2015 21:32
-
-
Save rpond-pa/6713f07ee6ef3aebd8a4 to your computer and use it in GitHub Desktop.
Ruby VM Instruction Sequence
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
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== | |
0000 trace 1 ( 1) | |
0002 putspecialobject 1 | |
0004 putspecialobject 2 | |
0006 putobject :foo | |
0008 putiseq foo | |
0010 opt_send_simple <callinfo!mid:core#define_method, argc:3, ARGS_SKIP> | |
0012 pop | |
0013 trace 1 ( 4) | |
0015 putself | |
0016 putself | |
0017 opt_send_simple <callinfo!mid:foo, argc:0, FCALL|VCALL|ARGS_SKIP> | |
0019 putstring "world" | |
0021 opt_plus <callinfo!mid:+, argc:1, ARGS_SKIP> | |
0023 opt_send_simple <callinfo!mid:puts, argc:1, FCALL|ARGS_SKIP> | |
0025 leave | |
== disasm: <RubyVM::InstructionSequence:foo@<compiled>>================= | |
0000 trace 8 ( 1) | |
0002 trace 1 ( 2) | |
0004 putstring "hello " | |
0006 trace 16 ( 3) | |
0008 leave ( 2) |
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
ins = RubyVM::InstructionSequence.new <<-RUBIES | |
def foo | |
"hello " | |
end | |
puts foo + "world" | |
RUBIES | |
puts ins.disasm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment