summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-03-04 21:26:46 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 23:28:59 -0800
commitc2fe6fa0d0b00aedc006af26ea4903c79e6d24a8 (patch)
treeeab740ee186d00f061655ca95e570e5bd29a6412 /lib/ruby_vm/mjit
parent2c25f0daaed7171e68bae31f692c72a5175978c0 (diff)
Chain-guard blockarg
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm/mjit')
-rw-r--r--lib/ruby_vm/mjit/insn_compiler.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb
index 4378a1e9a3..bb81fc87a3 100644
--- a/lib/ruby_vm/mjit/insn_compiler.rb
+++ b/lib/ruby_vm/mjit/insn_compiler.rb
@@ -2480,7 +2480,7 @@ module RubyVM::MJIT
# @param jit [RubyVM::MJIT::JITState]
# @param ctx [RubyVM::MJIT::Context]
# @param asm [RubyVM::MJIT::Assembler]
- def jit_guard_known_klass(jit, ctx, asm, known_klass, obj_opnd, comptime_obj, side_exit, limit: 5)
+ def jit_guard_known_klass(jit, ctx, asm, known_klass, obj_opnd, comptime_obj, side_exit, limit: 10)
# Only memory operand is supported for now
assert_equal(true, obj_opnd.is_a?(Array))
@@ -2908,12 +2908,12 @@ module RubyVM::MJIT
block_opnd = ctx.stack_opnd(0) # to be popped after eliminating side exit possibility
if block_code.nil?
asm.cmp(block_opnd, Qnil)
- asm.jne(counted_exit(side_exit, :send_block_not_nil))
+ jit_chain_guard(:jne, jit, ctx, asm, counted_exit(side_exit, :send_block_not_nil))
return C.VM_BLOCK_HANDLER_NONE
elsif C.to_value(block_code) == C.rb_block_param_proxy
asm.mov(:rax, C.rb_block_param_proxy)
asm.cmp(block_opnd, :rax)
- asm.jne(counted_exit(side_exit, :send_block_not_proxy))
+ jit_chain_guard(:jne, jit, ctx, asm, counted_exit(side_exit, :send_block_not_proxy))
return C.rb_block_param_proxy
else
asm.incr_counter(:send_blockarg_not_nil_or_proxy)