From 1b064227671fe780044406f163b117ef85f2f8b9 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 29 Mar 2023 17:57:52 -0400 Subject: 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. --- yjit/src/codegen.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'yjit/src') 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, }); -- cgit v1.2.1