diff --git a/vm_method.c b/vm_method.c index da891229f8..0bc32ad36f 100644 --- a/vm_method.c +++ b/vm_method.c @@ -787,10 +787,10 @@ method_entry_get_without_cache(VALUE klass, ID id, return me; } -#if VM_DEBUG_VERIFY_METHOD_CACHE static void verify_method_cache(VALUE klass, ID id, VALUE defined_class, rb_method_entry_t *me) { + if (!VM_DEBUG_VERIFY_METHOD_CACHE) return; VALUE actual_defined_class; rb_method_entry_t *actual_me = method_entry_get_without_cache(klass, id, &actual_defined_class); @@ -799,7 +799,6 @@ verify_method_cache(VALUE klass, ID id, VALUE defined_class, rb_method_entry_t * rb_bug("method cache verification failed"); } } -#endif static rb_method_entry_t * method_entry_get(VALUE klass, ID id, VALUE *defined_class_ptr) @@ -810,9 +809,7 @@ method_entry_get(VALUE klass, ID id, VALUE *defined_class_ptr) if (ent->method_state == GET_GLOBAL_METHOD_STATE() && ent->class_serial == RCLASS_SERIAL(klass) && ent->mid == id) { -#if VM_DEBUG_VERIFY_METHOD_CACHE verify_method_cache(klass, id, ent->defined_class, ent->me); -#endif if (defined_class_ptr) *defined_class_ptr = ent->defined_class; RB_DEBUG_COUNTER_INC(mc_global_hit); return ent->me;