summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2024-07-18 13:01:47 -0700
committerGitHub <[email protected]>2024-07-18 13:01:47 -0700
commit2de8b5b8054f311c4cee112dcab5208b66cc62a4 (patch)
treebd5f932cc396ace86bc6fcf78637e4be7586a62e /yjit/src
parent059535bd650bf2765fb8fd14e28d6e98f52871c2 (diff)
YJIT: Allow dev_nodebug to disasm release-mode code (#11198)
* YJIT: Allow dev_nodebug to disasm release-mode code * Revert "YJIT: Squash canary before falling back" This reverts commit f05ad373d84909da7541bd6d6ace38b48eaf24a1. The stray canary issue should have been solved by def7023ee4a3fc6eeba9d3a34c31a5bcff315fac, alleviating this codegen accommodation. * s/runtime_assertions/runtime_checks/ --------- Co-authored-by: Alan Wu <[email protected]>
Notes
Notes: Merged-By: k0kubun <[email protected]>
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/backend/ir.rs2
-rw-r--r--yjit/src/codegen.rs8
2 files changed, 2 insertions, 8 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs
index 599ecfabc9..3355dc5da3 100644
--- a/yjit/src/backend/ir.rs
+++ b/yjit/src/backend/ir.rs
@@ -1759,7 +1759,7 @@ impl Assembler {
// If the slot is already used, which is a valid optimization to avoid spills,
// give up the verification.
- let canary_opnd = if cfg!(debug_assertions) && self.leaf_ccall && opnds.iter().all(|opnd|
+ let canary_opnd = if cfg!(feature = "runtime_checks") && self.leaf_ccall && opnds.iter().all(|opnd|
opnd.get_reg_opnd() != canary_opnd.get_reg_opnd()
) {
asm_comment!(self, "set stack canary");
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 4abf58fea4..0baa3344a6 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -6587,7 +6587,7 @@ fn gen_send_cfunc(
cme,
recv,
sp,
- pc: if cfg!(debug_assertions) {
+ pc: if cfg!(feature = "runtime_checks") {
Some(!0) // Poison value. Helps to fail fast.
} else {
None // Leave PC uninitialized as cfuncs shouldn't read it
@@ -8385,12 +8385,6 @@ fn gen_send_dynamic<F: Fn(&mut Assembler) -> Opnd>(
// Save PC and SP to prepare for dynamic dispatch
jit_prepare_non_leaf_call(jit, asm);
- // Squash stack canary that might be left over from elsewhere
- assert_eq!(false, asm.get_leaf_ccall());
- if cfg!(debug_assertions) {
- asm.store(asm.ctx.sp_opnd(0), 0.into());
- }
-
// Dispatch a method
let ret = vm_sendish(asm);