In Perl_ck_subr(), move to once place all setting of bits in o->op_private.
authorNicholas Clark <nick@ccl4.org>
Mon, 13 Sep 2010 14:32:05 +0000 (15:32 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 13 Sep 2010 14:36:07 +0000 (15:36 +0100)
The later conditional setting of HINT_STRICT_REFS and of OPpENTERSUB_DB are
unaffected by any code triggered by cvop->op_type. Moving them together lets
the C compiler produce better code.

op.c

diff --git a/op.c b/op.c
index 35435f8..aa4e233 100644 (file)
--- a/op.c
+++ b/op.c
@@ -8407,6 +8407,10 @@ Perl_ck_subr(pTHX_ OP *o)
     PERL_ARGS_ASSERT_CK_SUBR;
 
     o->op_private |= OPpENTERSUB_HASTARG;
+    o->op_private |= (PL_hints & HINT_STRICT_REFS);
+    if (PERLDB_SUB && PL_curstash != PL_debstash)
+       o->op_private |= OPpENTERSUB_DB;
+
     for (cvop = o2; cvop->op_sibling; cvop = cvop->op_sibling) ;
     if (cvop->op_type == OP_RV2CV) {
        o->op_private |= (cvop->op_private & OPpENTERSUB_AMPER);
@@ -8444,9 +8448,7 @@ Perl_ck_subr(pTHX_ OP *o)
                sib->op_private &= ~OPpCONST_STRICT;
        }
     }
-    o->op_private |= (PL_hints & HINT_STRICT_REFS);
-    if (PERLDB_SUB && PL_curstash != PL_debstash)
-       o->op_private |= OPpENTERSUB_DB;
+
     if (!proto) {
        while (o2 != cvop) {
            OP* o3;