Dear Lazyweb: Proc disassembly in 1.9?

| | Comments (2)

Clue me? How do I disassemble a proc in 1.9?

>> p = proc { |n| n + 2 } 
=> #<Proc:0x3be994@(irb):1>
>> VM::InstructionSequence.disassemble p
>> class Temp1; end
>> Temp1.send :define_method, :m, p
=> #<Proc:0x3be9e4@(irb):1 (lambda)>
>> VM::InstructionSequence.disassemble(Temp1.instance_method :m)
=> nil
>> VM::InstructionSequence.disassemble(Temp1.new.method(:m))
=> nil
>> class Temp2; def m; 1 + 2; end; end
=> nil
>> puts VM::InstructionSequence.disassemble(Temp2.instance_method(:m))
== disasm: <ISeq:x@(irb)>===============================================
0000 putobject        1                                               (  12)
0002 putobject        2
0004 opt_plus         
0005 leave            
=> nil

2 Comments

Maybe [1] would help? [1] http://groups.google.com/group/ruby-core-google/browse_thread/thread/932c0ea1078e294a Thanks for your work on this stuff! Wish it were easier for 1.9, but we do what we can :) -=R

I also wonder if ludicrous has any insight into this. How is it able to translate 1.9 to libjit, for example.

Leave a comment

About this Entry

This page contains a single entry by zenspider published on June 23, 2008 1:25 PM.

hoe version 1.6.0 has been released! was the previous entry in this blog.

Are you a developer or a script-kiddie? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.23-en