Use const repl optimisation with s///e where possible
authorFather Chrysostomos <sprout@cpan.org>
Fri, 12 Oct 2012 03:22:08 +0000 (20:22 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 12 Oct 2012 06:07:36 +0000 (23:07 -0700)
commitef90d20ae1b70bb24316828c3249daee27459a7b
treea97bf2827b2c998d0b79c2d57603eca599853a08
parentfa4533d036f96ddb26c693c5b0c642b7cbc7d667
Use const repl optimisation with s///e where possible

In those cases where s///e contains a single variable or a sequence
that is folded to a const op, we can do away with substcont.

PMf_EVAL means that there was an /e.  But we don’t actually need to
check that; instead we can just examine the op tree, which we have to
do anyway.

The op tree that s//$x/e and s//"constant"/e compile down to have a
null (a do-block) containing a scope op (block with a single state-
ment, as opposed to op_leave which represents multiple statements)
containing a null followed by the constant or variable.
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/deparse.t
op.c
t/lib/warnings/9uninit