diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-07 21:46:58 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-08 00:33:02 -0800 |
commit | d8cdf5739e500a4f72aa611694308d7244c29573 (patch) | |
tree | 652494e1385679221ab2551bb565fd2304cfd5c5 /regen/opcodes | |
parent | 12cea2fa656447eef8848bac6de2e3fe413eb787 (diff) | |
download | perl-d8cdf5739e500a4f72aa611694308d7244c29573.tar.gz |
Allow OPpTARGET_MY optimisation for split
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This is safe to extend to split. split only uses its target in this
code at the end:
GETTARGET;
PUSHi(iters);
so there is no danger of modifying its argument before reading it.
Diffstat (limited to 'regen/opcodes')
-rw-r--r-- | regen/opcodes | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/regen/opcodes b/regen/opcodes index 6328b0ed29..be3bffe5f3 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -239,7 +239,7 @@ kvhslice key/value hash slice ck_null m@ H L unpack unpack ck_fun u@ S S? pack pack ck_fun fmst@ S L -split split ck_split t@ S S S +split split ck_split T@ S S S join join or string ck_join fmst@ S L # List operators. |