diff options
author | John Hawthorn <[email protected]> | 2021-12-10 17:08:05 -0800 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2021-12-14 15:22:51 -0800 |
commit | b7ae08992f7e4c663b61a3895d29d066fa22e452 (patch) | |
tree | 24b0dd85d23ad73561cd400b999843a0407da588 /vm.c | |
parent | b563f122972c98a9b988173f0e882249ca243624 (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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; + } + } } } |