diff options
author | Takashi Kokubun <[email protected]> | 2023-02-24 14:38:22 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 23:28:59 -0800 |
commit | 5576da7900162234c8e114b72401a8e0681c7c61 (patch) | |
tree | b9be6f3977796b5d17231e4ca5402f190c2da3a5 /lib/ruby_vm/mjit/compiler.rb | |
parent | 15cea7fd0d729a7646707e386d2e2b43d52f0421 (diff) |
Re-compile MJIT entry on constant IC update
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm/mjit/compiler.rb')
-rw-r--r-- | lib/ruby_vm/mjit/compiler.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ruby_vm/mjit/compiler.rb b/lib/ruby_vm/mjit/compiler.rb index 79a5da44a2..30f2557f5b 100644 --- a/lib/ruby_vm/mjit/compiler.rb +++ b/lib/ruby_vm/mjit/compiler.rb @@ -133,6 +133,12 @@ module RubyVM::MJIT list_blocks(iseq, pc).each do |block| invalidate_block(iseq, block) end + + # If they were the ISEQ's first blocks, re-compile MJIT entry as well + if iseq.body.iseq_encoded.to_i == pc + iseq.body.jit_func = 0 + iseq.body.total_calls = 0 + end end private @@ -255,7 +261,6 @@ module RubyVM::MJIT @cb.write(branch_asm) end end - # TODO: Reset jit_func and total_calls if it's the first block after prelude end def list_blocks(iseq, pc) |