Project

General

Profile

Feature #578 ยป add_disassemble_proc.diff

rogerdpack (Roger Pack), 09/21/2008 03:10 AM

View differences:

iseq.c (working copy)
928 928
    return ret;
929 929
}
930 930

  
931
static VALUE
932
iseq_s_disasm_proc(VALUE klass, VALUE proc)
933
{
934
  VALUE ret = Qnil; 
935
  rb_proc_t *proc_pointer;
936
  GetProcPtr(proc, proc_pointer);
937
  VALUE iseqval = (VALUE) proc_pointer->block.iseq->self;
938
  if (RUBY_VM_NORMAL_ISEQ_P(iseqval))
939
       ret = ruby_iseq_disasm(iseqval);
940

  
941
  return ret;
942
}
943
   
944

  
945

  
931 946
const char *
932 947
ruby_node_name(int node)
933 948
{
......
1339 1354
    rb_define_singleton_method(rb_cISeq, "compile_option=", iseq_s_compile_option_set, 1);
1340 1355
    rb_define_singleton_method(rb_cISeq, "disasm", iseq_s_disasm, 1);
1341 1356
    rb_define_singleton_method(rb_cISeq, "disassemble", iseq_s_disasm, 1);
1357
    rb_define_singleton_method(rb_cISeq, "disassemble_proc", iseq_s_disasm_proc, 1);
1342 1358
}
1343 1359