From c19d37375074987b36413af6bf83df7262ce227d Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 6 Jun 2015 10:19:48 +0000 Subject: * method.h: back to share rb_method_definition_t by rb_method_entry_t. r50728 changed sharing `def's to isolating `def's on alias and so on. However, this change conflicts future improvement plan. So I change back to sharing approach. * method.h: move rb_method_definition_t::flags to rb_method_entry_t::attr::flags. rb_method_entry_t::attr is union with VALUE because this field should have same size of VALUE. rb_method_entry_t is T_IMEMO). And also add the following access macros to it's fileds. * METHOD_ENTRY_VISI(me) * METHOD_ENTRY_BASIC(me) * METHOD_ENTRY_SAFE(me) * vm_method.c (rb_method_definition_addref): added instead of rb_method_definition_clone(). Do not create new definition, but increment alias_count. * class.c (clone_method): catch up this fix. * class.c (method_entry_i): ditto. * proc.c (mnew_internal): ditto. * proc.c (mnew_missing): ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'class.c') diff --git a/class.c b/class.c index 938c098918..b8b44c96f6 100644 --- a/class.c +++ b/class.c @@ -248,11 +248,11 @@ clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t * rb_cref_t *new_cref; newiseqval = rb_iseq_clone(me->def->body.iseq.iseqptr->self, new_klass); rb_vm_rewrite_cref(me->def->body.iseq.cref, old_klass, new_klass, &new_cref); - rb_add_method_iseq(new_klass, mid, newiseqval, new_cref, me->def->flags.visi); + rb_add_method_iseq(new_klass, mid, newiseqval, new_cref, METHOD_ENTRY_VISI(me)); RB_GC_GUARD(newiseqval); } else { - rb_method_entry_set(new_klass, mid, me, me->def->flags.visi); + rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me)); } } @@ -1129,7 +1129,7 @@ method_entry_i(st_data_t key, st_data_t value, st_data_t data) type = METHOD_VISI_UNDEF; /* none */ } else { - type = me->def->flags.visi; + type = METHOD_ENTRY_VISI(me); } st_add_direct(arg->list, key, (st_data_t)type); } -- cgit v1.2.3