Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created July 24, 2013 19:00
Show Gist options
  • Save tenderlove/6073446 to your computer and use it in GitHub Desktop.
Save tenderlove/6073446 to your computer and use it in GitHub Desktop.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment