summaryrefslogtreecommitdiff
path: root/scope.c
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 /scope.c
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 'scope.c')
-rw-r--r--scope.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 375240eee4..08456d4645 100644
--- a/scope.c
+++ b/scope.c
@@ -1366,10 +1366,11 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
PTR2UV(cx->blk_eval.retop));
break;
+ case CXt_LOOP_PLAIN:
case CXt_LOOP_LAZYIV:
case CXt_LOOP_LAZYSV:
- case CXt_LOOP_FOR:
- case CXt_LOOP_PLAIN:
+ case CXt_LOOP_LIST:
+ case CXt_LOOP_ARY:
PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n", CxLABEL(cx));
PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
(long)cx->blk_loop.resetsp);