This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Introduce the PUSHSUB_DB macro, equivalent to PUSHSUB, but
authorDave Mitchell <davem@fdisolutions.com>
Sun, 26 Jan 2003 17:42:42 +0000 (17:42 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 27 Jan 2003 20:38:21 +0000 (20:38 +0000)
without the lval context tweak. Used in OP_DBSTATE.
Subject: Re: [PATCH] Re: change #9754: 5 x slowdown for perl -d
Message-ID: <20030126174242.H16182@fdgroup.com>

p4raw-id: //depot/perl@18596

cop.h
pp_ctl.c

diff --git a/cop.h b/cop.h
index 870225c..de80033 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -120,13 +120,23 @@ struct block_sub {
     PAD                *oldcomppad;
 };
 
-#define PUSHSUB(cx)                                                    \
+/* base for the next two macros. Don't use directly */
+#define PUSHSUB_BASE(cx)                                               \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.olddepth = CvDEPTH(cv);                             \
-       cx->blk_sub.hasargs = hasargs;                                  \
+       cx->blk_sub.hasargs = hasargs;
+
+#define PUSHSUB(cx)                                                    \
+       PUSHSUB_BASE(cx)                                                \
        cx->blk_sub.lval = PL_op->op_private &                          \
                              (OPpLVAL_INTRO|OPpENTERSUB_INARGS);
 
+/* variant for use by OP_DBSTATE, where op_private holds hint bits */
+#define PUSHSUB_DB(cx)                                                 \
+       PUSHSUB_BASE(cx)                                                \
+       cx->blk_sub.lval = 0;
+
+
 #define PUSHFORMAT(cx)                                                 \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.gv = gv;                                            \
index 2e302ed..7c0f8ba 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1613,7 +1613,7 @@ PP(pp_dbstate)
 
        push_return(PL_op->op_next);
        PUSHBLOCK(cx, CXt_SUB, SP);
-       PUSHSUB(cx);
+       PUSHSUB_DB(cx);
        CvDEPTH(cv)++;
        (void)SvREFCNT_inc(cv);
        PAD_SET_CUR(CvPADLIST(cv),1);