summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-05-17 22:10:01 -0400
committerSteffen Mueller <smueller@cpan.org>2014-05-28 12:34:05 +0200
commit4fa715fa94837500ba695881194771a669c480ff (patch)
tree70a82b2c2b6ddf7f256e20456ff4f1f8f59f5314 /pp.c
parent65206418858b753c29362aa9d53c8e04a02030b5 (diff)
downloadperl-4fa715fa94837500ba695881194771a669c480ff.tar.gz
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
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 04c1f296ab..51335aae18 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)