From b7ae08992f7e4c663b61a3895d29d066fa22e452 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Fri, 10 Dec 2021 17:08:05 -0800 Subject: [PATCH] YJIT: Avoid unnecessary BOP invalidation Previously we would invalidate BOPs in YJIT when the method registered as a BOP was redefined on a subclass. --- vm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vm.c b/vm.c index 44b87c3d54..c5934d52a5 100644 --- a/vm.c +++ b/vm.c @@ -1885,9 +1885,11 @@ rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me, VALUE klass) if (vm_redefinition_check_method_type(me->def)) { if (st_lookup(vm_opt_method_def_table, (st_data_t)me->def, &bop)) { int flag = vm_redefinition_check_flag(klass); - rb_yjit_bop_redefined(klass, me, (enum ruby_basic_operators)bop); - ruby_vm_redefined_flag[bop] |= flag; - } + if (flag != 0) { + rb_yjit_bop_redefined(klass, me, (enum ruby_basic_operators)bop); + ruby_vm_redefined_flag[bop] |= flag; + } + } } }