From 4fa715fa94837500ba695881194771a669c480ff Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Sat, 17 May 2014 22:10:01 -0400 Subject: [PATCH] refactor pp_list -move PL_stack_sp and PL_stack_base reads into the branch in which they are used, this also removes 1 var from being saved across the function call in GIMME, which removes saving and restoring 1 non-vol register -write SP to PL_stack_sp (PUTBACK) only if it was changed -POPMARK is mutable, it must execute on all branches this reduced pp_list's machine code size of the function from 0x58 to 0x53 bytes on VC 2003 -01 32 bits --- pp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pp.c b/pp.c index 04c1f29..51335aa 100644 --- a/pp.c +++ b/pp.c @@ -4847,15 +4847,19 @@ PP(pp_kvhslice) PP(pp_list) { - dVAR; dSP; dMARK; + dVAR; + I32 markidx = POPMARK; if (GIMME != G_ARRAY) { + SV **mark = PL_stack_base + markidx; + dSP; if (++MARK <= SP) *MARK = *SP; /* unwanted list, return last item */ else *MARK = &PL_sv_undef; SP = MARK; + PUTBACK; } - RETURN; + return NORMAL; } PP(pp_lslice) -- 1.8.3.1