In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/b33a1a96a953a17844057156988e6402f194e0ba?hp=818355acb63e1db6f7c5d48165cd5afe6e8e0bc4>

- Log -----------------------------------------------------------------
commit b33a1a96a953a17844057156988e6402f194e0ba
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Mon Oct 20 17:52:36 2014 -0700

    Increase $B::Deparse::VERSION to 1.30

M       lib/B/Deparse.pm

commit 8538e2d4d47f3b235052cbaabfe1aa035ae18916
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Mon Oct 20 17:16:01 2014 -0700

    Rmv restrictions on op tree structure for padrange
    
    The padrange optimisation was only happening if the op tree was laid
    out in a way that would allow B::Deparse easily to restore the origi-
    nal op_next pointers (via $B::overlay) for the sake of deparsing.
    It turns out that B::Deparse doesn’t even use the op_next pointers
    (except for deparsing ‘use’ statements, which are not affected here),
    so there is no need for these restrictions.
    
    In the case of my($a,$b)=@_, @_ was expected to be the sibling of the
    preceding pushmark-cum-padrange.  Removing that restriction doesn’t
    allow the padrange optimisation to happen in any new cases as far as I
    can tell.  It just means there is less checking to do.
    
    In the more general case of a list of lexicals with no =@_, this
    allows padrange to be used for array and hash slices in conjunction
    with a separate list-in-list-context optimisation, that formerly con-
    flicted with padrange.
    
    When we compile @a[$lex1,$lex2], we end up with a redundant list-in-
    list-context:
    
     7  aslice
     1    pushmark
     5    list
     2      pushmark
     3      padsv
     4      padsv
     6    padav (assuming the array is lexical
    
    Pushmark pushes a mark on to the markstack, and list pops one, so
    pushmark and list cancel each other out in list context.
    
    In 5.18, when padrange was introduced, this was optimised like this:
    
     5  aslice
     1    pushmark
     3    list
     2      padrange
     -      padsv
     -      padsv
     4    padav
    
    Then a separate optimisation was added in 5.20 that allows a list
    with a pushmark kid to turn into null ops, and this cancelled out
    the padrange:
    
     5  aslice
     1    pushmark
     -    ex-list
     -      ex-pushmark
     2      padsv
     3      padsv
     4    padav
    
    Bunchmarks show that this is slightly faster than padrange with two
    lexicals, but more lexicals would make padrange faster.  This commit
    brings us the goodness of both optimisations at once:
    
     3  aslice
     1    padrange
     -    ex-list
     -      ex-pushmark
     -      padsv
     -      padsv
     2    padav
    
    And it is faster than just one optimisation.

M       lib/B/Deparse.pm
M       op.c

commit 40ba772c3f3fa292e5635bb62c0a68609c27fcdb
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Mon Oct 20 16:51:55 2014 -0700

    op.c: No need to check the name of *_
    
    Checking against PL_defgv is sufficient.

M       op.c
-----------------------------------------------------------------------

Summary of changes:
 lib/B/Deparse.pm |  5 +----
 op.c             | 13 +------------
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm
index 3866f32..53f4e6b 100644
--- a/lib/B/Deparse.pm
+++ b/lib/B/Deparse.pm
@@ -21,7 +21,7 @@ use B qw(class main_root main_start main_cv svref_2object 
opnumber perlstring
          CVf_METHOD CVf_LVALUE
         PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE
         PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED PMf_EXTENDED_MORE);
-$VERSION = '1.29';
+$VERSION = '1.30';
 use strict;
 use vars qw/$AUTOLOAD/;
 use warnings ();
@@ -358,9 +358,6 @@ sub _pessimise_walk {
                    type => OP_PUSHMARK,
                    name => 'pushmark',
                    private => ($op->private & OPpLVAL_INTRO),
-                   next    => ($op->flags & OPf_SPECIAL)
-                                   ? $op->sibling->first
-                                   : $op->sibling,
            };
        }
 
diff --git a/op.c b/op.c
index c1672ed..6ac8f3f 100644
--- a/op.c
+++ b/op.c
@@ -11937,21 +11937,15 @@ Perl_rpeep(pTHX_ OP *o)
             /* look for a pushmark -> gv[_] -> rv2av */
 
             {
-                GV *gv;
                 OP *rv2av, *q;
                 p = o->op_next;
                 if (   p->op_type == OP_GV
-                    && (gv = cGVOPx_gv(p)) && isGV(gv)
-                    && GvNAMELEN_get(gv) == 1
-                    && *GvNAME_get(gv) == '_'
-                    && GvSTASH(gv) == PL_defstash
+                    && cGVOPx_gv(p) == PL_defgv
                     && (rv2av = p->op_next)
                     && rv2av->op_type == OP_RV2AV
                     && !(rv2av->op_flags & OPf_REF)
                     && !(rv2av->op_private & (OPpLVAL_INTRO|OPpMAYBE_LVSUB))
                     && ((rv2av->op_flags & OPf_WANT) == OPf_WANT_LIST)
-                    && OP_SIBLING(o) == rv2av /* these two for Deparse */
-                    && cUNOPx(rv2av)->op_first == p
                 ) {
                     q = rv2av->op_next;
                     if (q->op_type == OP_NULL)
@@ -11963,11 +11957,6 @@ Perl_rpeep(pTHX_ OP *o)
                 }
             }
             if (!defav) {
-                /* To allow Deparse to pessimise this, it needs to be able
-                 * to restore the pushmark's original op_next, which it
-                 * will assume to be the same as OP_SIBLING. */
-                if (o->op_next != OP_SIBLING(o))
-                    break;
                 p = o;
             }
 

--
Perl5 Master Repository

Reply via email to