This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fold join to const or stringify where possible
authorFather Chrysostomos <sprout@cpan.org>
Sat, 11 Oct 2014 08:21:12 +0000 (01:21 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 12 Oct 2014 07:23:48 +0000 (00:23 -0700)
commit987c96916e35a543383e96eebb4ef8b2c8ef66d0
tree2586dda189c5dba1004914e2247c8a8a705104ad
parentef7999f1f1914f1a33743bbfa196e39f7f041445
Fold join to const or stringify where possible

Due to the exigencies of the implementation, "$_->$*" ends up with a
join op (join $", $$_), which is unnecessary.  This gave me the idea
of folding it where possible (instead of trying to tackle it in
toke.c), which would also make explicit joins benefit, too.

If the arguments are a simple scalar or constant followed by a
single-item list, then the join can become a stringify, and the sepa-
rator can simply disappear.

Further (and this is unrelated to "$_->$*"), if all of join’s argu-
ments are constant, the whole thing can be folded to a const op.
MANIFEST
lib/B/Deparse-core.t
op.c
opcode.h
regen/opcodes
sv.c
t/lib/warnings/9uninit
t/lib/warnings/op
t/op/opt.t [new file with mode: 0644]