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/opcodes | |
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/opcodes')
-rw-r--r-- | regen/opcodes | 2 |
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? |