summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit/insn_compiler.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-13 00:00:26 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 23:28:59 -0800
commit9bce848b4cde9f0868dee290dfe4249421164252 (patch)
treeb312ef1ef4e2101ac7449dbe4a6bfb48d2a57ea4 /lib/ruby_vm/mjit/insn_compiler.rb
parent11bd040b8900ea2e55c1188ceb59dd5694be8336 (diff)
Side-exit earlier on interrupts
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm/mjit/insn_compiler.rb')
-rw-r--r--lib/ruby_vm/mjit/insn_compiler.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb
index a9b808dec2..78b63a08e9 100644
--- a/lib/ruby_vm/mjit/insn_compiler.rb
+++ b/lib/ruby_vm/mjit/insn_compiler.rb
@@ -1192,6 +1192,9 @@ module RubyVM::MJIT
return CantCompile
end
+ # Check interrupts before SP motion to safely side-exit with the original SP.
+ jit_check_ints(jit, ctx, asm)
+
# Save caller SP and PC before pushing a callee frame for backtrace and side exits
asm.comment('save SP to caller CFP')
sp_index = -(1 + argc) # Pop receiver and arguments for side exits # TODO: subtract one more for VM_CALL_ARGS_BLOCKARG
@@ -1200,8 +1203,6 @@ module RubyVM::MJIT
ctx.sp_offset = -sp_index
jit_save_pc(jit, asm, comment: 'save PC to caller CFP')
- jit_check_ints(jit, ctx, asm)
-
# Push a callee frame. SP register and ctx are not modified inside this.
jit_push_frame(jit, ctx, asm, ci, cme, flags, argc, frame_type)