svp is a pointer to a pad array slice. It is derefed to set a sv flag.
It's optimized scope previous extended past the savestack_grow call. By
moving the flag setting before any calls in save_clearsv, svp does not have
to be carried across any calls. On some platforms there will be a benefit
(args transfered in vol regs for example, AMD64 Win64), on others none
since it will be reread from the stack after any child call anyway. I
assume the SvPADSTALE_off flag will have no effect on the panic croak.
After this commit, the only auto var carried through a call is
offset_shifted (and unavoidably my_perl).
I saw a drop in the size of save_clearsv from 0x5A to 0x58. The saving
and use of 1 nonvol reg on x86 32 bit VC 2003 was reduced, total stack
frame reduced by 1 pointer, since VC 2003 read svp off the stack only
once at the start of save_clearsv and kept it in a nonvol reg for the rest
of this func's body.
PERL_ARGS_ASSERT_SAVE_CLEARSV;
ASSERT_CURPAD_ACTIVE("save_clearsv");
+ SvPADSTALE_off(*svp); /* mark lexical as active */
if ((offset_shifted >> SAVE_TIGHT_SHIFT) != offset)
Perl_croak(aTHX_ "panic: pad offset %"UVuf" out of range (%p-%p)",
offset, svp, PL_curpad);
SSCHECK(1);
SSPUSHUV(offset_shifted | SAVEt_CLEARSV);
- SvPADSTALE_off(*svp); /* mark lexical as active */
}
void