This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix common assign issue on @a = (split(), 1)
authorDavid Mitchell <davem@iabyn.com>
Mon, 19 Sep 2016 14:39:34 +0000 (15:39 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 4 Oct 2016 10:18:40 +0000 (11:18 +0100)
commit47a8f19b6f8f837245506422e5a4d36804e7b56a
tree440117f4ea662c607be9195091a01ad97032efe8
parent692044df8403d4568b919fe9ad7e282e864ec85e
fix common assign issue on @a = (split(), 1)

RT #127999 Slowdown in split + list assign

The compile-time common-value detection mechanism for OP_ASSIGN
was getting OP_SPLIT wrong.

It was assuming that OP_SPLIT was always dangerous. In fact,
OP_SPLIT is usually completely safe, not passing though any of its
arguments, except where the assign in (@a = split()) has been optimised
away and the array attached directly to the OP_SPLIT op, or the ops that
produce the array have been appended as an extra child of the OP_SPLIT op
(OPf_STACKED).
op.c
t/perf/benchmarks
t/perf/optree.t