summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-12-10 17:08:05 -0800
committerJohn Hawthorn <john@hawthorn.email>2021-12-14 15:22:51 -0800
commitb7ae08992f7e4c663b61a3895d29d066fa22e452 (patch)
tree24b0dd85d23ad73561cd400b999843a0407da588 /vm.c
parentb563f122972c98a9b988173f0e882249ca243624 (diff)
YJIT: Avoid unnecessary BOP invalidation
Previously we would invalidate BOPs in YJIT when the method registered as a BOP was redefined on a subclass.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5271
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c8
1 files 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;
+ }
+ }
}
}