summaryrefslogtreecommitdiff
path: root/regen/opcodes
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-07 14:43:39 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-07 20:14:36 -0800
commitdb098081e3682316e8cf22b9705c2563fc91eaec (patch)
treed6995b6da841611dcb53586165ced017401d05ce /regen/opcodes
parent93f5d0e84de625ae81930095bb540c0d9dbda3f2 (diff)
downloadperl-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/opcodes')
-rw-r--r--regen/opcodes2
1 files changed, 1 insertions, 1 deletions
diff --git a/regen/opcodes b/regen/opcodes
index 6c3f63e1b8..0df672086b 100644
--- a/regen/opcodes
+++ b/regen/opcodes
@@ -194,7 +194,7 @@ abs abs ck_fun fsTu% S?
length length ck_length ifsTu% S?
substr substr ck_substr st@ S S S? S?
-vec vec ck_fun ist@ S S S
+vec vec ck_fun isT@ S S S
index index ck_index isT@ S S S?
rindex rindex ck_index isT@ S S S?