summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-03-29 17:57:52 -0400
committerGitHub <noreply@github.com>2023-03-29 17:57:52 -0400
commit1b064227671fe780044406f163b117ef85f2f8b9 (patch)
treee943381fd0bff79556c6541af9e456b7ca551842 /yjit/src
parenta1a4d77472475fc9ee4c16cce7b79f6f492c91c3 (diff)
downloadruby-1b064227671fe780044406f163b117ef85f2f8b9.tar.gz
YJIT: Leave cfp->pc uninitialized for VM_FRAME_MAGIC_CFUNC
C function frames don't need to use the VM-specific pc field to run properly. When pushing a control frame from output code, save one instruction by leaving the field uninitialized. Fix-up rb_vm_svar_lep(), which is used while setting local variables via Regexp#=~. Use cfp->iseq as a secondary signal so it can stop assuming that all CFUNC frames always have zero pc's.
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 577031c86e..2ea64871b3 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -5095,7 +5095,11 @@ fn gen_send_cfunc(
cme,
recv,
sp,
- pc: Some(0),
+ pc: if cfg!(debug_assertions) {
+ Some(!0) // Poison value. Helps to fail fast.
+ } else {
+ None // Leave PC uninitialized as cfuncs shouldn't read it
+ },
iseq: None,
local_size: 0,
});