diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-24 13:57:20 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-24 13:57:20 +0000 |
commit | 493b0a3c46c2cc9f06bf88c450ded6aa981c4fd3 (patch) | |
tree | 7d6dfdd735cd260a345eb8489b3d7976428943eb /pp_hot.c | |
parent | c25bf6989edf21dd302c4e306179cfffbc11bb5f (diff) | |
download | perl-493b0a3c46c2cc9f06bf88c450ded6aa981c4fd3.tar.gz |
In struct block_loop, merge itermax and iterlval into a union
lval_max_u, as CXt_LOOP_LAZYIV doesn't use iterlval and the other
LOOP types don't use itermax. This reduces struct block_loop by 1 IV.
As it's the largest component of the unions making up struct context,
this reduces struct context. On ILP32 it will now be 56 bytes, down
from the 64 of 5.10.x, as I've already removed the element 'label'.
p4raw-id: //depot/perl@33063
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1917,7 +1917,7 @@ PP(pp_iter) /* iterate ($min .. $max) */ if (CxTYPE(cx) != CXt_LOOP_LAZYIV) { /* string increment */ - register SV* cur = cx->blk_loop.iterlval; + register SV* cur = cx->blk_loop.lval_max_u.iterlval; STRLEN maxlen = 0; const char *max = SvOK((SV*)av) ? @@ -1945,8 +1945,7 @@ PP(pp_iter) RETPUSHNO; } /* integer increment */ - assert(!cx->blk_loop.iterlval); - if (cx->blk_loop.iterix > cx->blk_loop.itermax) + if (cx->blk_loop.iterix > cx->blk_loop.lval_max_u.itermax) RETPUSHNO; /* don't risk potential race */ @@ -1966,10 +1965,10 @@ PP(pp_iter) /* Handle end of range at IV_MAX */ if ((cx->blk_loop.iterix == IV_MIN) && - (cx->blk_loop.itermax == IV_MAX)) + (cx->blk_loop.lval_max_u.itermax == IV_MAX)) { cx->blk_loop.iterix++; - cx->blk_loop.itermax++; + cx->blk_loop.lval_max_u.itermax++; } RETPUSHYES; @@ -2014,7 +2013,7 @@ PP(pp_iter) else sv = &PL_sv_undef; if (av != PL_curstack && sv == &PL_sv_undef) { - SV *lv = cx->blk_loop.iterlval; + SV *lv = cx->blk_loop.lval_max_u.iterlval; if (lv && SvREFCNT(lv) > 1) { SvREFCNT_dec(lv); lv = NULL; @@ -2022,7 +2021,7 @@ PP(pp_iter) if (lv) SvREFCNT_dec(LvTARG(lv)); else { - lv = cx->blk_loop.iterlval = newSV_type(SVt_PVLV); + lv = cx->blk_loop.lval_max_u.iterlval = newSV_type(SVt_PVLV); LvTYPE(lv) = 'y'; sv_magic(lv, NULL, PERL_MAGIC_defelem, NULL, 0); } |