Change 33035 by [EMAIL PROTECTED] on 2008/01/21 17:50:03

        Eliminate the U8 sbu_once from struct subst, and shrink sbu_rflags from
        I32 to U8, which reduces the size of the struct by at least 4 bytes.

Affected files ...

... //depot/perl/cop.h#163 edit
... //depot/perl/pp_hot.c#558 edit

Differences ...

==== //depot/perl/cop.h#163 (text) ====
Index: perl/cop.h
--- perl/cop.h#162~33034~       2008-01-21 09:21:40.000000000 -0800
+++ perl/cop.h  2008-01-21 09:50:03.000000000 -0800
@@ -601,11 +601,10 @@
 /* substitution context */
 struct subst {
     U8         sbu_type;       /* what kind of context this is */
-    U8         sbu_once;       /* Actually both booleans, but U8/U16 */
+    U8         sbu_rflags;
     U16                sbu_rxtainted;  /* matches struct block */
     I32                sbu_iters;
     I32                sbu_maxiters;
-    I32                sbu_rflags;
     I32                sbu_oldsave;
     char *     sbu_orig;
     SV *       sbu_dstr;
@@ -636,7 +635,6 @@
        cx->sb_maxiters         = maxiters,                             \
        cx->sb_rflags           = r_flags,                              \
        cx->sb_oldsave          = oldsave,                              \
-       cx->sb_once             = once,                                 \
        cx->sb_rxtainted        = rxtainted,                            \
        cx->sb_orig             = orig,                                 \
        cx->sb_dstr             = dstr,                                 \
@@ -646,11 +644,11 @@
        cx->sb_strend           = strend,                               \
        cx->sb_rxres            = NULL,                                 \
        cx->sb_rx               = rx,                                   \
-       cx->cx_type             = CXt_SUBST;                            \
+       cx->cx_type             = CXt_SUBST | (once ? CXp_ONCE : 0);    \
        rxres_save(&cx->sb_rxres, rx);                                  \
        (void)ReREFCNT_inc(rx)
 
-#define CxONCE(cx)             (0 + cx->sb_once)
+#define CxONCE(cx)             ((cx)->cx_type & CXp_ONCE)
 
 #define POPSUBST(cx) cx = &cxstack[cxstack_ix--];                      \
        rxres_free(&cx->sb_rxres);                                      \
@@ -698,6 +696,8 @@
 #  define CxPADLOOP(c) (((c)->cx_type & (CXt_LOOP|CXp_PADVAR))         \
                         == (CXt_LOOP|CXp_PADVAR))
 #endif
+/* private flags for CXt_SUBST */
+#define CXp_ONCE       0x10    /* What was sbu_once in struct subst */
 
 #define CxTYPE(c)      ((c)->cx_type & CXTYPEMASK)
 #define CxMULTICALL(c) (((c)->cx_type & CXp_MULTICALL)                 \

==== //depot/perl/pp_hot.c#558 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#557~33033~    2008-01-21 08:50:59.000000000 -0800
+++ perl/pp_hot.c       2008-01-21 09:50:03.000000000 -0800
@@ -1227,7 +1227,7 @@
     register const char *s;
     const char *strend;
     I32 global;
-    I32 r_flags = REXEC_CHECKED;
+    U8 r_flags = REXEC_CHECKED;
     const char *truebase;                      /* Start of string  */
     register REGEXP *rx = PM_GETRE(pm);
     bool rxtainted;
@@ -2053,7 +2053,7 @@
     bool once;
     U8 rxtainted;
     char *orig;
-    I32 r_flags;
+    U8 r_flags;
     register REGEXP *rx = PM_GETRE(pm);
     STRLEN len;
     int force_on_match = 0;
End of Patch.

Reply via email to