diff options
author | David Mitchell <davem@iabyn.com> | 2012-10-30 15:10:06 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-11-10 13:39:32 +0000 |
commit | d5524600caf9e8c470e731c4f5a924868154645a (patch) | |
tree | abed2ab4c1c8d698b7fe2c5efdeaec392b680e57 /pp.c | |
parent | 528ad060d8dbad9e971c22550cece80330a23dd3 (diff) | |
download | perl-d5524600caf9e8c470e731c4f5a924868154645a.tar.gz |
padrange: handle @_ directly
In a construct like
my ($x,$y) = @_
the pushmark/padsv/padsv is already optimised into a single padrange
op. This commit makes the OPf_SPECIAL flag on the padrange op indicate
that in addition, @_ should be pushed onto the stack, skipping an
additional pushmark/gv[*_]/rv2sv combination.
So in total (including the earlier padrange work), the above construct
goes from being
3 <0> pushmark s
4 <$> gv(*_) s
5 <1> rv2av[t3] lK/1
6 <0> pushmark sRM*/128
7 <0> padsv[$x:1,2] lRM*/LVINTRO
8 <0> padsv[$y:1,2] lRM*/LVINTRO
9 <2> aassign[t4] vKS
to
3 <0> padrange[$x:1,2; $y:1,2] l*/LVINTRO,2 ->4
4 <2> aassign[t4] vKS
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -84,6 +84,7 @@ PP(pp_padav) } gimme = GIMME_V; if (gimme == G_ARRAY) { + /* XXX see also S_pushav in pp_hot.c */ const I32 maxarg = AvFILL(MUTABLE_AV(TARG)) + 1; EXTEND(SP, maxarg); if (SvMAGICAL(TARG)) { |