summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2024-04-26 13:02:22 -0700
committerGitHub <[email protected]>2024-04-26 13:02:22 -0700
commitab228bd0844758a1c444e39030c153874adf9120 (patch)
tree0713c0e3186dcd85d08cd8994414586398722136 /yjit/src
parent46480e3042fed08a6b4f2ff96b5acc1539b812b1 (diff)
YJIT: Try splitting getlocal/setlocal blocks (#10648)
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 000f9fb516..50d65335f4 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2265,6 +2265,12 @@ fn gen_getlocal_generic(
ep_offset: u32,
level: u32,
) -> Option<CodegenStatus> {
+ // Start the block with this instruction for EP-escape invalidation
+ if level == 0 && !jit.at_current_insn() {
+ defer_compilation(jit, asm, ocb);
+ return Some(EndBlock);
+ }
+
let local_opnd = if level == 0 && jit.assume_no_ep_escape(asm, ocb) {
// Load the local using SP register
asm.ctx.ep_opnd(-(ep_offset as i32))
@@ -2326,6 +2332,12 @@ fn gen_setlocal_generic(
ep_offset: u32,
level: u32,
) -> Option<CodegenStatus> {
+ // Start the block with this instruction for EP-escape invalidation
+ if level == 0 && !jit.at_current_insn() {
+ defer_compilation(jit, asm, ocb);
+ return Some(EndBlock);
+ }
+
let value_type = asm.ctx.get_opnd_type(StackOpnd(0));
// Fallback because of write barrier