2010-02-21から1日間の記事一覧

Ruby1.9でのダンプの仕方

1.9ではVMの命令にダンプできます。 puts RubyVM::InstructionSequence.new('puts "hoge"').disasm ほかにeval、to_aとかが使える。 == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== 0000 trace 1 ( 1) 0002 putnil 0003 putstring "hoge" 0005 send :puts, 1, nil, 8, <ic> 0011 leave</ic></compiled></rubyvm::instructionsequence:<compiled>…