summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-08 08:56:50 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-08 08:56:50 +0000
commitfa043eb4e8764902beb1ff1e89ef6af98e6d7725 (patch)
tree13a10402445dd1df9b721a7982169df241a7246a
parente4c06f3c22f075722979e298d9c0c8dbe63431fe (diff)
vm.c: cleanup to use rb_method_entry_at
* vm.c (add_opt_method): cleanup to use rb_method_entry_at Easier experiments with a non-st method entry tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--vm.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f05c90a..b968eab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Mar 8 17:42:51 2014 Eric Wong <e@80x24.org>
+
+ * vm.c (add_opt_method): cleanup to use rb_method_entry_at
+
Sat Mar 8 13:46:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
diff --git a/vm.c b/vm.c
index 08c96d5..d9ac028 100644
--- a/vm.c
+++ b/vm.c
@@ -1147,8 +1147,9 @@ rb_vm_check_redefinition_by_prepend(VALUE klass)
static void
add_opt_method(VALUE klass, ID mid, VALUE bop)
{
- rb_method_entry_t *me;
- if (st_lookup(RCLASS_M_TBL(klass), mid, (void *)&me) && me->def &&
+ rb_method_entry_t *me = rb_method_entry_at(klass, mid);
+
+ if (me && me->def &&
me->def->type == VM_METHOD_TYPE_CFUNC) {
st_insert(vm_opt_method_table, (st_data_t)me, (st_data_t)bop);
}