summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:23:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:23:42 +0000
commitf2c319395ddb3239f4bf71861db3dc0c175c32bd (patch)
tree69a841d55b8f1734029c8e3aa12013a8f7dca2b5 /vm_method.c
parentc7005118880ceeff65b300479317ca8387ec1246 (diff)
vm.c: reduce clearing method cache
* vm_method.c (rb_add_method, rb_alias): rb_method_entry_set() already clears method cache. * vm_method.c (rb_export_method): ditto by rb_add_method(). * vm_method.c (set_method_visibility): ditto by rb_export_method(). * vm.c (vm_define_method): ditto by rb_add_method(). * vm.c (m_core_undef_method): ditto by rb_add_method() in rb_undef(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/vm_method.c b/vm_method.c
index 0b707975bf..a95c37e30e 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -478,7 +478,6 @@ rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_
if (type != VM_METHOD_TYPE_UNDEF && type != VM_METHOD_TYPE_REFINED) {
method_added(klass, mid);
}
- rb_clear_method_cache_by_class(klass);
return me;
}
@@ -799,6 +798,7 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
if (me->def->type == VM_METHOD_TYPE_REFINED) {
me->def->body.orig_me->flag = noex;
}
+ rb_clear_method_cache_by_class(klass);
}
else {
rb_add_method(klass, name, VM_METHOD_TYPE_ZSUPER, 0, noex);
@@ -1246,7 +1246,6 @@ rb_alias(VALUE klass, ID name, ID def)
if (flag == NOEX_UNDEF) flag = orig_me->flag;
rb_method_entry_set(target_klass, name, orig_me, flag);
- rb_clear_method_cache_by_class(target_klass);
}
/*
@@ -1301,7 +1300,6 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex)
}
rb_export_method(self, id, ex);
}
- rb_clear_method_cache_by_class(self);
}
static VALUE