summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2019-09-17 14:20:40 +0100
committerDavid Mitchell <davem@iabyn.com>2019-09-19 08:42:46 +0100
commit740449bf2292b54e1824f48789ef1a15877469d5 (patch)
tree779b4f0cc325d4c946583d021a2dc15ce53cd42d /scope.c
parent20550e1aa3f65750f061802d4df74a3faaf463a9 (diff)
downloadperl-740449bf2292b54e1824f48789ef1a15877469d5.tar.gz
add PL_curstackinfo->si_cxsubix field
This tracks the most recent sub/eval/format context pushed onto the context stack. Then make dopopto_cursub use it. The previous value is saved in the cxt struct, and is restored whenever the context is popped. This adds a tiny overhead for every sub call, but speeds up other operations, such as determining the caller context when returning a value from a sub - this has to be dpne for every sub call where the last expression is context sensitive, so its often a win.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 9b1393c69d..c6616440f6 100644
--- a/scope.c
+++ b/scope.c
@@ -82,6 +82,7 @@ Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
si->si_next = 0;
si->si_cxmax = cxitems - 1;
si->si_cxix = -1;
+ si->si_cxsubix = -1;
si->si_type = PERLSI_UNDEF;
Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
/* Without any kind of initialising CX_PUSHSUBST()