Reset chain_depth in more places

This commit is contained in:
Takashi Kokubun 2023-03-04 22:13:20 -08:00
parent 4a124dc1de
commit bd0d0d3b38
Notes: git 2023-03-06 07:29:33 +00:00
2 changed files with 5 additions and 0 deletions

View file

@ -239,6 +239,10 @@ module RubyVM::MJIT
case status = @insn_compiler.compile(jit, ctx, asm, insn) case status = @insn_compiler.compile(jit, ctx, asm, insn)
when KeepCompiling when KeepCompiling
# For now, reset the chain depth after each instruction as only the
# first instruction in the block can concern itself with the depth.
ctx.chain_depth = 0
index += insn.len index += insn.len
when EndBlock when EndBlock
# TODO: pad nops if entry exit exists (not needed for x86_64?) # TODO: pad nops if entry exit exists (not needed for x86_64?)

View file

@ -3623,6 +3623,7 @@ module RubyVM::MJIT
return_ctx = ctx.dup return_ctx = ctx.dup
return_ctx.stack_size -= argc # Pop args. blockarg has been popped return_ctx.stack_size -= argc # Pop args. blockarg has been popped
return_ctx.sp_offset = 1 # SP is in the position after popping a receiver and arguments return_ctx.sp_offset = 1 # SP is in the position after popping a receiver and arguments
return_ctx.chain_depth = 0
branch_stub = BranchStub.new( branch_stub = BranchStub.new(
iseq: jit.iseq, iseq: jit.iseq,
shape: Default, shape: Default,