diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-10-11 01:21:12 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-10-12 00:23:48 -0700 |
commit | 987c96916e35a543383e96eebb4ef8b2c8ef66d0 (patch) | |
tree | 2586dda189c5dba1004914e2247c8a8a705104ad /opcode.h | |
parent | ef7999f1f1914f1a33743bbfa196e39f7f041445 (diff) | |
download | perl-987c96916e35a543383e96eebb4ef8b2c8ef66d0.tar.gz |
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.
Diffstat (limited to 'opcode.h')
-rw-r--r-- | opcode.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1888,7 +1888,7 @@ EXTCONST U32 PL_opargs[] = { 0x00091480, /* unpack */ 0x0002140f, /* pack */ 0x00111408, /* split */ - 0x0002140d, /* join */ + 0x0002140f, /* join */ 0x00002401, /* list */ 0x00224200, /* lslice */ 0x00002405, /* anonlist */ |