diff options
author | David Mitchell <davem@iabyn.com> | 2011-07-18 20:14:10 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-07-18 20:24:42 +0100 |
commit | f11ca51e41e898a77f1fd33b9e0371e69b1be73a (patch) | |
tree | 71338052cd58ae1032cd6973d07e97d4a61a025a /op.c | |
parent | eba804b9d4475c6d8d4728933792c5b7ca90fbf5 (diff) | |
download | perl-f11ca51e41e898a77f1fd33b9e0371e69b1be73a.tar.gz |
Perl_rpeep: undo tail recursion optimisation
commit 3c78429c102e0fe2ad30c60dfe52636b6071ef19 reduced the depth
of recursion in rpeep(), by deferring recursion into branches until a bit
later (so that the recursive call to rpeep was then likely to be shallow).
However, it went one step further: when the chain of op_next's had been
exhausted in the main loop, it processed any remaining deferrred branches
in the main loop rather than recursing. All nice and efficient, but it
broke the expectation that someone who had hooked into rpeep could follow
the chain of op_nexts in each call and visit *all* ops.
This commit removes that optimisation and restores the rpeep hook
expectancy. This shouldn't have any major effect on the depth of
recursion, and its minor inefficiency doesn't really matter for a
one-time compilation-time pass.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -9338,8 +9338,7 @@ Perl_rpeep(pTHX_ register OP *o) while (!o) { if (defer_ix < 0) break; - o = defer_queue[(defer_base + defer_ix--) % MAX_DEFERRED]; - oldop = NULL; + CALL_RPEEP(defer_queue[(defer_base + defer_ix--) % MAX_DEFERRED]); } if (!o) break; |