diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-07 14:43:39 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-07 20:14:36 -0800 |
commit | db098081e3682316e8cf22b9705c2563fc91eaec (patch) | |
tree | d6995b6da841611dcb53586165ced017401d05ce /regen/op_private | |
parent | 93f5d0e84de625ae81930095bb540c0d9dbda3f2 (diff) | |
download | perl-db098081e3682316e8cf22b9705c2563fc91eaec.tar.gz |
Allow OPpTARGET_MY optimisation for vec
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 can be extended to vec(). Despite what the comment in op_pri-
vate says, lvalue usage does not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in rvalue context. And
the rvalue code paths use TARG and push TARG on to the stack.
Diffstat (limited to 'regen/op_private')
-rw-r--r-- | regen/op_private | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/regen/op_private b/regen/op_private index 8d82142ad7..40c8bb9f64 100644 --- a/regen/op_private +++ b/regen/op_private @@ -332,7 +332,6 @@ addbits($_, 7 => qw(OPpLVAL_INTRO LVINTRO)) # If the target coincides with one of the arguments ==> kaboom. # # pp.c pos substr each not OK (RETPUSHUNDEF) -# substr vec also not OK due to LV to target (are they???) # ref not OK (RETPUSHNO) # trans not OK (dTARG; TARG = sv_newmortal();) # ucfirst etc not OK: TMP arg processed inplace |