This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
padrange: handle @_ directly
authorDavid Mitchell <davem@iabyn.com>
Tue, 30 Oct 2012 15:10:06 +0000 (15:10 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 10 Nov 2012 13:39:32 +0000 (13:39 +0000)
commitd5524600caf9e8c470e731c4f5a924868154645a
treeabed2ab4c1c8d698b7fe2c5efdeaec392b680e57
parent528ad060d8dbad9e971c22550cece80330a23dd3
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
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/deparse.t
ext/B/t/optree_misc.t
ext/B/t/optree_varinit.t
op.c
op.h
pp.c
pp_hot.c