summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-10-17 00:18:44 +0100
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:18:29 +0000
commit93661e56c6b52b1bf34963a3a62b2a766381cccd (patch)
tree8948b55e3e1b49cbe32d79b407abedf985c121b3 /lib
parent0724084c5ac1086f135da52e9e7cf29cc2280640 (diff)
downloadperl-93661e56c6b52b1bf34963a3a62b2a766381cccd.tar.gz
split CXt_LOOP_FOR into CXt_LOOP_LIST,CXt_LOOP_ARY
Create a new context type so that "for (1,2,3)" and "for (@ary)" are now two separate types. For the list type, we store the index of the base stack element in the state union rather than having an array pointer. Currently this is just the same as blk_resetsp, but this will shortly allow us to eliminate the resetsp field from the struct block_loop - which is currently the largest sub-struct within the block union. Having two separate types also allows the two cases to be handled directly in the main switch in the hot pp_iter code, rather than having extra conditionals.
Diffstat (limited to 'lib')
-rw-r--r--lib/B/Op_private.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm
index 85076ee251..7825f79f3d 100644
--- a/lib/B/Op_private.pm
+++ b/lib/B/Op_private.pm
@@ -130,7 +130,7 @@ $bits{$_}{2} = 'OPpFT_STACKED' for qw(ftatime ftbinary ftblk ftchr ftctime ftdir
$bits{$_}{3} = 'OPpFT_STACKING' for qw(ftatime ftbinary ftblk ftchr ftctime ftdir fteexec fteowned fteread ftewrite ftfile ftis ftlink ftmtime ftpipe ftrexec ftrowned ftrread ftrwrite ftsgid ftsize ftsock ftsuid ftsvtx fttext fttty ftzero);
$bits{$_}{1} = 'OPpHINT_STRICT_REFS' for qw(entersub multideref rv2av rv2cv rv2gv rv2hv rv2sv);
$bits{$_}{5} = 'OPpHUSH_VMSISH' for qw(dbstate nextstate);
-$bits{$_}{2} = 'OPpITER_REVERSED' for qw(enteriter iter);
+$bits{$_}{1} = 'OPpITER_REVERSED' for qw(enteriter iter);
$bits{$_}{7} = 'OPpLVALUE' for qw(leave leaveloop);
$bits{$_}{6} = 'OPpLVAL_DEFER' for qw(aelem helem multideref);
$bits{$_}{7} = 'OPpLVAL_INTRO' for qw(aelem aslice cond_expr delete enteriter entersub gvsv helem hslice list lvavref lvref lvrefslice multideref padav padhv padrange padsv pushmark refassign rv2av rv2gv rv2hv rv2sv);
@@ -604,7 +604,7 @@ our %defines = (
OPpHINT_STRICT_REFS => 2,
OPpHUSH_VMSISH => 32,
OPpITER_DEF => 8,
- OPpITER_REVERSED => 4,
+ OPpITER_REVERSED => 2,
OPpLIST_GUESSED => 64,
OPpLVALUE => 128,
OPpLVAL_DEFER => 64,