Change 33018 by [EMAIL PROTECTED] on 2008/01/20 22:20:56

        Eliminate hasargs from structs block_sub and block_format by storing
        it with a private flag CXp_HASARGS in cx_type. (It's only a boolean.)

Affected files ...

... //depot/perl/cop.h#154 edit
... //depot/perl/pp_ctl.c#661 edit

Differences ...

==== //depot/perl/cop.h#154 (text) ====
Index: perl/cop.h
--- perl/cop.h#153~33017~       2008-01-20 13:50:31.000000000 -0800
+++ perl/cop.h  2008-01-20 14:20:56.000000000 -0800
@@ -282,7 +282,6 @@
     OP *       retop;  /* op to execute on exit from sub */
     /* Above here is the same for sub, format and eval.  */
     CV *       cv;
-    U8         hasargs;
     U8         lval;           /* XXX merge lval and hasargs? */
     /* Above here is the same for sub and format.  */
     AV *       savearray;
@@ -297,7 +296,6 @@
     OP *       retop;  /* op to execute on exit from sub */
     /* Above here is the same for sub, format and eval.  */
     CV *       cv;
-    U8         hasargs;
     U8         lval;           /* XXX merge lval and hasargs? */
     /* Above here is the same for sub and format.  */
     GV *       gv;
@@ -315,7 +313,7 @@
                                                                        \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.olddepth = CvDEPTH(cv);                             \
-       cx->blk_sub.hasargs = hasargs;                                  \
+       cx->cx_type |= (hasargs) ? CXp_HASARGS : 0;                     \
        cx->blk_sub.retop = NULL;                                       \
        if (!CvDEPTH(cv)) {                                             \
            SvREFCNT_inc_simple_void_NN(cv);                            \
@@ -339,7 +337,6 @@
        cx->blk_format.cv = cv;                                         \
        cx->blk_format.gv = gv;                                         \
        cx->blk_format.retop = (retop);                                 \
-       cx->blk_format.hasargs = 0;                                     \
        cx->blk_format.dfoutgv = PL_defoutgv;                           \
        SvREFCNT_inc_void(cx->blk_format.dfoutgv)
 
@@ -488,7 +485,7 @@
            cx->blk_loop.itersave = NULL;
 #endif
 #define CxLABEL(c)     (0 + (c)->blk_oldcop->cop_label)
-#define CxHASARGS(c)   (0 + (c)->blk_sub.hasargs)
+#define CxHASARGS(c)   (((c)->cx_type & CXp_HASARGS) == CXp_HASARGS)
 #define CxLVAL(c)      (0 + (c)->blk_sub.lval)
 
 #ifdef USE_ITHREADS
@@ -675,6 +672,9 @@
 #define CXp_MULTICALL  0x00000400      /* part of a multicall (so don't
                                           tear down context on exit). */ 
 
+/* private flags for CXt_SUB and CXt_FORMAT */
+#define CXp_HASARGS    0x00000200
+
 /* private flags for CXt_EVAL */
 #define CXp_REAL       0x00000100      /* truly eval'', not a lookalike */
 #define CXp_TRYBLOCK   0x00000200      /* eval{}, not eval'' or similar */

==== //depot/perl/pp_ctl.c#661 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#660~33017~    2008-01-20 13:50:31.000000000 -0800
+++ perl/pp_ctl.c       2008-01-20 14:20:56.000000000 -0800
@@ -2440,7 +2440,6 @@
                    PL_in_eval = cx->blk_eval.old_in_eval;
                    PL_eval_root = cx->blk_eval.old_eval_root;
                    cx->cx_type = CXt_SUB;
-                   cx->blk_sub.hasargs = 0;
                }
                cx->blk_sub.cv = cv;
                cx->blk_sub.olddepth = CvDEPTH(cv);
End of Patch.

Reply via email to