Change 33157 by [EMAIL PROTECTED] on 2008/01/31 21:43:37

        Integrate:
        [ 33010]
        In struct block_loop access element label via the macro CxLABEL()
        (for the places that aren't about to change)
        
        [ 33017]
        In struct block_sub and block_format, access the members hasargs and
        lval via macros CxHASARGS() and CxLVAL(), which will allow the storage
        location to be changed.
        
        [ 33029]
        In struct block_eval, access the members old_in_eval and old_op_type
        via macros CxOLD_IN_EVAL() and CxOLD_OP_TYPE(), which will allow the
        storage location to be changed.
        
        [ 33034]
        In struct block_subst, access the member once via a macro CxONCE()
        which will allow the storage location to be changed.

Affected files ...

... //depot/maint-5.10/perl/cop.h#4 integrate
... //depot/maint-5.10/perl/pp_ctl.c#7 integrate
... //depot/maint-5.10/perl/pp_hot.c#10 integrate
... //depot/maint-5.10/perl/scope.c#2 integrate
... //depot/maint-5.10/perl/sv.c#6 integrate

Differences ...

==== //depot/maint-5.10/perl/cop.h#4 (text) ====
Index: perl/cop.h
--- perl/cop.h#3~33156~ 2008-01-31 13:12:44.000000000 -0800
+++ perl/cop.h  2008-01-31 13:43:37.000000000 -0800
@@ -342,7 +342,7 @@
 
 #define POPSUB(cx,sv)                                                  \
     STMT_START {                                                       \
-       if (cx->blk_sub.hasargs) {                                      \
+       if (CxHASARGS(cx)) {                                            \
            POP_SAVEARRAY();                                            \
            /* abandon @_ if it got reified */                          \
            if (AvREAL(cx->blk_sub.argarray)) {                         \
@@ -384,6 +384,9 @@
     JMPENV *   cur_top_env; /* value of PL_top_env when eval CX created */
 };
 
+#define CxOLD_IN_EVAL(cx)      (0 + (cx)->blk_eval.old_in_eval)
+#define CxOLD_OP_TYPE(cx)      (0 + (cx)->blk_eval.old_op_type)
+
 #define PUSHEVAL(cx,n,fgv)                                             \
     STMT_START {                                                       \
        cx->blk_eval.old_in_eval = PL_in_eval;                          \
@@ -398,8 +401,8 @@
 
 #define POPEVAL(cx)                                                    \
     STMT_START {                                                       \
-       PL_in_eval = cx->blk_eval.old_in_eval;                          \
-       optype = cx->blk_eval.old_op_type;                              \
+       PL_in_eval = CxOLD_IN_EVAL(cx);                                 \
+       optype = CxOLD_OP_TYPE(cx);                                     \
        PL_eval_root = cx->blk_eval.old_eval_root;                      \
        if (cx->blk_eval.old_namesv)                                    \
            sv_2mortal(cx->blk_eval.old_namesv);                        \
@@ -465,6 +468,9 @@
        else                                                            \
            cx->blk_loop.itersave = NULL;
 #endif
+#define CxLABEL(c)     (0 + (c)->blk_loop.label)
+#define CxHASARGS(c)   (0 + (c)->blk_sub.hasargs)
+#define CxLVAL(c)      (0 + (c)->blk_sub.lval)
 
 #ifdef USE_ITHREADS
 #  define PUSHLOOP_OP_NEXT             /* No need to do anything.  */
@@ -622,6 +628,8 @@
        rxres_save(&cx->sb_rxres, rx);                                  \
        (void)ReREFCNT_inc(rx)
 
+#define CxONCE(cx)             (0 + cx->sb_once)
+
 #define POPSUBST(cx) cx = &cxstack[cxstack_ix--];                      \
        rxres_free(&cx->sb_rxres);                                      \
        ReREFCNT_dec(cx->sb_rx)

==== //depot/maint-5.10/perl/pp_ctl.c#7 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#6~33155~      2008-01-31 13:06:11.000000000 -0800
+++ perl/pp_ctl.c       2008-01-31 13:43:37.000000000 -0800
@@ -221,7 +221,7 @@
        FREETMPS; /* Prevent excess tmp stack */
 
        /* Are we done */
-       if (cx->sb_once || !CALLREGEXEC(rx, s, cx->sb_strend, orig,
+       if (CxONCE(cx) || !CALLREGEXEC(rx, s, cx->sb_strend, orig,
                                     s == m, cx->sb_targ, NULL,
                                     ((cx->sb_rflags & REXEC_COPY_STR)
                                      ? (REXEC_IGNOREPOS|REXEC_NOT_FIRST)
@@ -1295,8 +1295,8 @@
     const I32 cxix = dopoptosub(cxstack_ix);
     assert(cxix >= 0);  /* We should only be called from inside subs */
 
-    if (cxstack[cxix].blk_sub.lval && CvLVALUE(cxstack[cxix].blk_sub.cv))
-       return cxstack[cxix].blk_sub.lval;
+    if (CxLVAL(cxstack + cxix) && CvLVALUE(cxstack[cxix].blk_sub.cv))
+       return CxLVAL(cxstack + cxix);
     else
        return 0;
 }
@@ -1641,11 +1641,11 @@
            SV * const sv = newSV(0);
            gv_efullname3(sv, cvgv, NULL);
            mPUSHs(sv);
-           mPUSHi((I32)cx->blk_sub.hasargs);
+           mPUSHi((I32)CxHASARGS(cx));
        }
        else {
            PUSHs(newSVpvs_flags("(unknown)", SVs_TEMP));
-           mPUSHi((I32)cx->blk_sub.hasargs);
+           mPUSHi((I32)CxHASARGS(cx));
        }
     }
     else {
@@ -1659,7 +1659,7 @@
        mPUSHi(gimme & G_ARRAY);
     if (CxTYPE(cx) == CXt_EVAL) {
        /* eval STRING */
-       if (cx->blk_eval.old_op_type == OP_ENTEREVAL) {
+       if (CxOLD_OP_TYPE(cx) == OP_ENTEREVAL) {
            PUSHs(cx->blk_eval.cur_text);
            PUSHs(&PL_sv_no);
        }
@@ -1678,7 +1678,7 @@
        PUSHs(&PL_sv_undef);
        PUSHs(&PL_sv_undef);
     }
-    if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs
+    if (CxTYPE(cx) == CXt_SUB && CxHASARGS(cx)
        && CopSTASH_eq(PL_curcop, PL_debstash))
     {
        AV * const ary = cx->blk_sub.argarray;
@@ -2355,7 +2355,7 @@
            }
            else if (CxMULTICALL(cx))
                DIE(aTHX_ "Can't goto subroutine from a sort sub (or similar 
callback)");
-           if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.hasargs) {
+           if (CxTYPE(cx) == CXt_SUB && CxHASARGS(cx)) {
                /* put @_ back onto stack */
                AV* av = cx->blk_sub.argarray;
 
@@ -2414,7 +2414,7 @@
            else {
                AV* const padlist = CvPADLIST(cv);
                if (CxTYPE(cx) == CXt_EVAL) {
-                   PL_in_eval = cx->blk_eval.old_in_eval;
+                   PL_in_eval = CxOLD_IN_EVAL(cx);
                    PL_eval_root = cx->blk_eval.old_eval_root;
                    cx->cx_type = CXt_SUB;
                    cx->blk_sub.hasargs = 0;
@@ -2432,7 +2432,7 @@
                }
                SAVECOMPPAD();
                PAD_SET_CUR_NOSAVE(padlist, CvDEPTH(cv));
-               if (cx->blk_sub.hasargs)
+               if (CxHASARGS(cx))
                {
                    AV* const av = (AV*)PAD_SVl(0);
 

==== //depot/maint-5.10/perl/pp_hot.c#10 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#9~33155~      2008-01-31 13:06:11.000000000 -0800
+++ perl/pp_hot.c       2008-01-31 13:43:37.000000000 -0800
@@ -2484,7 +2484,7 @@
 
     TAINT_NOT;
 
-    if (cx->blk_sub.lval & OPpENTERSUB_INARGS) {
+    if (CxLVAL(cx) & OPpENTERSUB_INARGS) {
        /* We are an argument to a function or grep().
         * This kind of lvalueness was legal before lvalue
         * subroutines too, so be backward compatible:
@@ -2511,7 +2511,7 @@
            }
        }
     }
-    else if (cx->blk_sub.lval) {     /* Leave it as it is if we can. */
+    else if (CxLVAL(cx)) {     /* Leave it as it is if we can. */
        /* Here we go for robustness, not for speed, so we change all
         * the refcounts so the caller gets a live guy. Cannot set
         * TEMP, so sv_2mortal is out of question. */

==== //depot/maint-5.10/perl/scope.c#2 (text) ====
Index: perl/scope.c
--- perl/scope.c#1~32694~       2007-12-22 01:23:09.000000000 -0800
+++ perl/scope.c        2008-01-31 13:43:37.000000000 -0800
@@ -1053,7 +1053,7 @@
        PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
                PTR2UV(cx->blk_sub.dfoutgv));
        PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
-               (int)cx->blk_sub.hasargs);
+                     (int)CxHASARGS(cx));
        PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
                PTR2UV(cx->blk_sub.retop));
        break;
@@ -1063,18 +1063,17 @@
        PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
                (long)cx->blk_sub.olddepth);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
-               (int)cx->blk_sub.hasargs);
-       PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n",
-               (int)cx->blk_sub.lval);
+               (int)CxHASARGS(cx));
+       PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n", (int)CxLVAL(cx));
        PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
                PTR2UV(cx->blk_sub.retop));
        break;
     case CXt_EVAL:
        PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
-               (long)cx->blk_eval.old_in_eval);
+               (long)CxOLD_IN_EVAL(cx));
        PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n",
-               PL_op_name[cx->blk_eval.old_op_type],
-               PL_op_desc[cx->blk_eval.old_op_type]);
+               PL_op_name[CxOLD_OP_TYPE(cx)],
+               PL_op_desc[CxOLD_OP_TYPE(cx)]);
        if (cx->blk_eval.old_namesv)
            PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
                          SvPVX_const(cx->blk_eval.old_namesv));
@@ -1085,8 +1084,7 @@
        break;
 
     case CXt_LOOP:
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n",
-               cx->blk_loop.label);
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n", CxLABEL(cx));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
                (long)cx->blk_loop.resetsp);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.MY_OP = 0x%"UVxf"\n",
@@ -1114,7 +1112,7 @@
        PerlIO_printf(Perl_debug_log, "SB_RFLAGS = %ld\n",
                (long)cx->sb_rflags);
        PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
-               (long)cx->sb_once);
+               (long)CxONCE(cx));
        PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
                cx->sb_orig);
        PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",

==== //depot/maint-5.10/perl/sv.c#6 (text) ====
Index: perl/sv.c
--- perl/sv.c#5~33139~  2008-01-30 15:19:42.000000000 -0800
+++ perl/sv.c   2008-01-31 13:43:37.000000000 -0800
@@ -10385,7 +10385,7 @@
                ncx->blk_sub.cv         = (ncx->blk_sub.olddepth == 0
                                           ? cv_dup_inc(ncx->blk_sub.cv, param)
                                           : cv_dup(ncx->blk_sub.cv,param));
-               ncx->blk_sub.argarray   = (ncx->blk_sub.hasargs
+               ncx->blk_sub.argarray   = (CxHASARGS(ncx)
                                           ? av_dup_inc(ncx->blk_sub.argarray,
                                                        param)
                                           : NULL);
End of Patch.

Reply via email to