This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexp.h: Move bits around
authorKarl Williamson <public@khwilliamson.com>
Sun, 1 Aug 2010 04:20:43 +0000 (22:20 -0600)
committerRafael Garcia-Suarez <rgs@consttype.org>
Wed, 11 Aug 2010 08:23:35 +0000 (10:23 +0200)
make regen needed.

This commit moves some bits in extflags around so that all the unallocated
ones are at the boundary between the unshared portion and the portion
shared with op.h.  This allows them to be allocated in the future to go
either way, without affecting binary compatibility at that time.

The high-order bits are unaffected, but the low order ones move to fill
the gap.

pod/perl5134delta.pod
regexp.h
regnodes.h

index f7e76bd..418ac88 100644 (file)
@@ -84,6 +84,11 @@ when loading every newly compiled extension, compares the API version of the
 running perl with the version a module has been compiled for and raises an
 exception if they don't match.
 
 running perl with the version a module has been compiled for and raises an
 exception if they don't match.
 
+=head2 Binary Incompatible with all previous Perls
+
+Some bit fields have been reordered, hence this release will not be binary
+comptible with any previous Perl release.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
index f041177..298a417 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -281,7 +281,9 @@ and check for NULL.
  *
  */
 
  *
  */
 
-#define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+2)
+/* Leave some space, so future bit allocations can go either in the shared or
+ * unshared area without affecting binary compatibility */
+#define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+3)
 
 /* Anchor and GPOS related stuff */
 #define RXf_ANCH_BOL           (1<<(RXf_BASE_SHIFT+0))
 
 /* Anchor and GPOS related stuff */
 #define RXf_ANCH_BOL           (1<<(RXf_BASE_SHIFT+0))
@@ -305,33 +307,33 @@ and check for NULL.
 #define RXf_CHECK_ALL          (1<<(RXf_BASE_SHIFT+10))
 
 /* UTF8 related */
 #define RXf_CHECK_ALL          (1<<(RXf_BASE_SHIFT+10))
 
 /* UTF8 related */
-#define RXf_MATCH_UTF8         (1<<(RXf_BASE_SHIFT+12))
+#define RXf_MATCH_UTF8         (1<<(RXf_BASE_SHIFT+11))
 
 /* Intuit related */
 
 /* Intuit related */
-#define RXf_USE_INTUIT_NOML    (1<<(RXf_BASE_SHIFT+13))
-#define RXf_USE_INTUIT_ML      (1<<(RXf_BASE_SHIFT+14))
-#define RXf_INTUIT_TAIL        (1<<(RXf_BASE_SHIFT+15))
+#define RXf_USE_INTUIT_NOML    (1<<(RXf_BASE_SHIFT+12))
+#define RXf_USE_INTUIT_ML      (1<<(RXf_BASE_SHIFT+13))
+#define RXf_INTUIT_TAIL        (1<<(RXf_BASE_SHIFT+14))
 
 /*
   Set in Perl_pmruntime if op_flags & OPf_SPECIAL, i.e. split. Will
   be used by regex engines to check whether they should set
   RXf_SKIPWHITE
 */
 
 /*
   Set in Perl_pmruntime if op_flags & OPf_SPECIAL, i.e. split. Will
   be used by regex engines to check whether they should set
   RXf_SKIPWHITE
 */
-#define RXf_SPLIT              (1<<(RXf_BASE_SHIFT+16))
+#define RXf_SPLIT              (1<<(RXf_BASE_SHIFT+15))
 
 #define RXf_USE_INTUIT         (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML)
 
 /* Copy and tainted info */
 
 #define RXf_USE_INTUIT         (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML)
 
 /* Copy and tainted info */
-#define RXf_COPY_DONE          (1<<(RXf_BASE_SHIFT+17))
-#define RXf_TAINTED_SEEN       (1<<(RXf_BASE_SHIFT+18))
-#define RXf_TAINTED            (1<<(RXf_BASE_SHIFT+19)) /* this pattern is tainted */
+#define RXf_COPY_DONE          (1<<(RXf_BASE_SHIFT+16))
+#define RXf_TAINTED_SEEN       (1<<(RXf_BASE_SHIFT+17))
+#define RXf_TAINTED            (1<<(RXf_BASE_SHIFT+18)) /* this pattern is tainted */
 
 /* Flags indicating special patterns */
 
 /* Flags indicating special patterns */
-#define RXf_START_ONLY         (1<<(RXf_BASE_SHIFT+20)) /* Pattern is /^/ */
-#define RXf_SKIPWHITE          (1<<(RXf_BASE_SHIFT+21)) /* Pattern is for a split / / */
-#define RXf_WHITE              (1<<(RXf_BASE_SHIFT+22)) /* Pattern is /\s+/ */
-#define RXf_NULL               (1<<(RXf_BASE_SHIFT+23)) /* Pattern is // */
-#if RXf_BASE_SHIFT+23 > 31
+#define RXf_START_ONLY         (1<<(RXf_BASE_SHIFT+19)) /* Pattern is /^/ */
+#define RXf_SKIPWHITE          (1<<(RXf_BASE_SHIFT+20)) /* Pattern is for a split / / */
+#define RXf_WHITE              (1<<(RXf_BASE_SHIFT+21)) /* Pattern is /\s+/ */
+#define RXf_NULL               (1<<(RXf_BASE_SHIFT+22)) /* Pattern is // */
+#if RXf_BASE_SHIFT+22 > 31
 #   error Too many RXf_PMf bits used.  See regnodes.h for any spare in middle
 #endif
 
 #   error Too many RXf_PMf bits used.  See regnodes.h for any spare in middle
 #endif
 
index 348410c..d132013 100644 (file)
@@ -625,7 +625,7 @@ EXTCONST char * const PL_reg_name[] = {
 EXTCONST char * PL_reg_extflags_name[];
 #else
 EXTCONST char * const PL_reg_extflags_name[] = {
 EXTCONST char * PL_reg_extflags_name[];
 #else
 EXTCONST char * const PL_reg_extflags_name[] = {
-       /* Bits in extflags defined: 11111111111101111111111100111111 */
+       /* Bits in extflags defined: 11111111111111111111111000111111 */
        "MULTILINE",        /* 0x00000001 */
        "SINGLELINE",       /* 0x00000002 */
        "FOLD",             /* 0x00000004 */
        "MULTILINE",        /* 0x00000001 */
        "SINGLELINE",       /* 0x00000002 */
        "FOLD",             /* 0x00000004 */
@@ -634,18 +634,18 @@ EXTCONST char * const PL_reg_extflags_name[] = {
        "LOCALE",           /* 0x00000020 */
        "UNUSED_BIT_6",     /* 0x00000040 */
        "UNUSED_BIT_7",     /* 0x00000080 */
        "LOCALE",           /* 0x00000020 */
        "UNUSED_BIT_6",     /* 0x00000040 */
        "UNUSED_BIT_7",     /* 0x00000080 */
-       "ANCH_BOL",         /* 0x00000100 */
-       "ANCH_MBOL",        /* 0x00000200 */
-       "ANCH_SBOL",        /* 0x00000400 */
-       "ANCH_GPOS",        /* 0x00000800 */
-       "GPOS_SEEN",        /* 0x00001000 */
-       "GPOS_FLOAT",       /* 0x00002000 */
-       "LOOKBEHIND_SEEN",  /* 0x00004000 */
-       "EVAL_SEEN",        /* 0x00008000 */
-       "CANY_SEEN",        /* 0x00010000 */
-       "NOSCAN",           /* 0x00020000 */
-       "CHECK_ALL",        /* 0x00040000 */
-       "UNUSED_BIT_19",    /* 0x00080000 */
+       "UNUSED_BIT_8",     /* 0x00000100 */
+       "ANCH_BOL",         /* 0x00000200 */
+       "ANCH_MBOL",        /* 0x00000400 */
+       "ANCH_SBOL",        /* 0x00000800 */
+       "ANCH_GPOS",        /* 0x00001000 */
+       "GPOS_SEEN",        /* 0x00002000 */
+       "GPOS_FLOAT",       /* 0x00004000 */
+       "LOOKBEHIND_SEEN",  /* 0x00008000 */
+       "EVAL_SEEN",        /* 0x00010000 */
+       "CANY_SEEN",        /* 0x00020000 */
+       "NOSCAN",           /* 0x00040000 */
+       "CHECK_ALL",        /* 0x00080000 */
        "MATCH_UTF8",       /* 0x00100000 */
        "USE_INTUIT_NOML",  /* 0x00200000 */
        "USE_INTUIT_ML",    /* 0x00400000 */
        "MATCH_UTF8",       /* 0x00100000 */
        "USE_INTUIT_NOML",  /* 0x00200000 */
        "USE_INTUIT_ML",    /* 0x00400000 */