diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2014-05-17 22:10:01 -0400 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2014-05-28 12:34:05 +0200 |
commit | 4fa715fa94837500ba695881194771a669c480ff (patch) | |
tree | 70a82b2c2b6ddf7f256e20456ff4f1f8f59f5314 /pp.c | |
parent | 65206418858b753c29362aa9d53c8e04a02030b5 (diff) | |
download | perl-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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |