From 254477248cde5bf82c4f256dca05b13d01c9774c Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 12 Dec 2019 15:47:59 -0800 Subject: Skip optimized method check for most method IDs Previously every time a method was defined on a module, we would recursively walk all subclasses to see if the module was included in a class which the VM optimizes for (such as Integer#+). For most method definitions we can tell immediately that this won't be the case based on the method's name. To do this we just keep a hash with method IDs of optimized methods and if our new method isn't in that list we don't need to check subclasses at all. --- internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'internal.h') diff --git a/internal.h b/internal.h index 3bd95c2c25..fe2b028f47 100644 --- a/internal.h +++ b/internal.h @@ -2282,6 +2282,7 @@ const char *rb_source_location_cstr(int *pline); MJIT_STATIC void rb_vm_pop_cfunc_frame(void); int rb_vm_add_root_module(ID id, VALUE module); void rb_vm_check_redefinition_by_prepend(VALUE klass); +int rb_vm_check_optimizable_mid(VALUE mid); VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements); MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE); PUREFUNC(st_table *rb_vm_fstring_table(void)); -- cgit v1.2.1