From c330876d7c5065f89234becc5125426d0d136bdc Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 15 Jul 2009 14:59:41 +0000 Subject: * method.h, vm_core.h: add rb_method_entry_t. Remove nodes around method management. This change affect some VM control stack structure. * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some refactoring. * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto. * vm_core.h, compile.c (iseq_specialized_instruction): remove VM_CALL_SEND_BIT. use another optimization tech for Kernel#send. * node.h: remove unused node types. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c: add mark/free functions for method entry. * include/ruby/intern.h: remove decl of rb_define_notimplement_method_id(). nobody can use it because noex is not opend. * iseq.c (iseq_mark): fix to check ic_method is available. * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 711712a4db..643e399c06 100644 --- a/iseq.c +++ b/iseq.c @@ -107,6 +107,9 @@ iseq_mark(void *ptr) for (i=0; iic_size; i++) { RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_class); RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_value); + if (iseq->ic_entries[i].ic_method) { + rb_gc_mark_method_entry(iseq->ic_entries[i].ic_method); + } } if (iseq->compile_data != 0) { @@ -1002,17 +1005,14 @@ rb_iseq_disasm(VALUE self) static VALUE iseq_s_disasm(VALUE klass, VALUE body) { - extern NODE *rb_method_body(VALUE body); - NODE *node; VALUE ret = Qnil; + rb_iseq_t *iseq; + extern rb_iseq_t *rb_method_get_iseq(VALUE body); rb_secure(1); - if ((node = rb_method_body(body)) != 0) { - if (nd_type(node) == RUBY_VM_METHOD_NODE) { - VALUE iseqval = (VALUE)node->nd_body; - ret = rb_iseq_disasm(iseqval); - } + if ((iseq = rb_method_get_iseq(body)) != 0) { + ret = rb_iseq_disasm(iseq->self); } return ret; -- cgit v1.2.3