summaryrefslogtreecommitdiff
path: root/regen/op_private
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-07 21:46:58 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-08 00:33:02 -0800
commitd8cdf5739e500a4f72aa611694308d7244c29573 (patch)
tree652494e1385679221ab2551bb565fd2304cfd5c5 /regen/op_private
parent12cea2fa656447eef8848bac6de2e3fe413eb787 (diff)
downloadperl-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/op_private')
-rw-r--r--regen/op_private2
1 files changed, 1 insertions, 1 deletions
diff --git a/regen/op_private b/regen/op_private
index 090df37006..dc46b8ae1a 100644
--- a/regen/op_private
+++ b/regen/op_private
@@ -336,7 +336,7 @@ addbits($_, 7 => qw(OPpLVAL_INTRO LVINTRO))
# trans not OK (dTARG; TARG = sv_newmortal();)
# ucfirst etc not OK: TMP arg processed inplace
# quotemeta not OK (unsafe when TARG == arg)
-# pack split - unknown whether they are safe
+# pack - unknown whether it is safe
# sprintf: is calling do_sprintf(TARG,...) which can act on TARG
# before other args are processed.
#