This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Optimise @lexarray = split...
authorFather Chrysostomos <sprout@cpan.org>
Sun, 12 Oct 2014 06:33:40 +0000 (23:33 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 12 Oct 2014 06:33:40 +0000 (23:33 -0700)
commitfd017c00b1282d493d81ce54d392bc0c3a3ae001
tree8d99c0b8946fdc9d0944caa436ec1d976781cbbf
parente05542ee69e4e58f0e9b4f9d5348f4cd31449bcd
Optimise @lexarray = split...

‘@pkgary = split //, $foo’ gets optimised such that the split writes
directly to the array and the assignment doesn’t have to happen.

This commit makes it work also with lexical arrays.  It only works for
arrays declared previously; ‘my @a = split’ doesn’t get optimised,
just as ‘local @a = split’ doesn’t.

The pad offset is stored in the op_targ field of the pushre op, just
as the GV is stored in its op_pmreplrootu field.
lib/B/Deparse.pm
op.c
pp.c