This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Renumber OPpLVREF_TYPE
authorFather Chrysostomos <sprout@cpan.org>
Mon, 29 Sep 2014 22:48:24 +0000 (15:48 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 11 Oct 2014 04:57:30 +0000 (21:57 -0700)
to avoid conflicting with OPpPAD_STATE.

lib/B/Op_private.pm
opcode.h
regen/op_private

index 4167f22..714fc31 100644 (file)
@@ -197,18 +197,6 @@ my @bf = (
         bitmask   => 255,
     },
     {
-        mask_def  => 'OPpLVREF_TYPE',
-        bitmin    => 3,
-        bitmax    => 4,
-        bitmask   => 24,
-        enum      => [
-            0, 'OPpLVREF_SV', 'SV',
-            1, 'OPpLVREF_AV', 'AV',
-            2, 'OPpLVREF_HV', 'HV',
-            3, 'OPpLVREF_CV', 'CV',
-        ],
-    },
-    {
         mask_def  => 'OPpDEREF',
         bitmin    => 5,
         bitmax    => 6,
@@ -219,6 +207,18 @@ my @bf = (
             3, 'OPpDEREF_SV', 'DREFSV',
         ],
     },
+    {
+        mask_def  => 'OPpLVREF_TYPE',
+        bitmin    => 5,
+        bitmax    => 6,
+        bitmask   => 96,
+        enum      => [
+            0, 'OPpLVREF_SV', 'SV',
+            1, 'OPpLVREF_AV', 'AV',
+            2, 'OPpLVREF_HV', 'HV',
+            3, 'OPpLVREF_CV', 'CV',
+        ],
+    },
 );
 
 @{$bits{aassign}}{6,1,0} = ('OPpASSIGN_COMMON', $bf[1], $bf[1]);
@@ -226,7 +226,7 @@ $bits{abs}{0} = $bf[0];
 @{$bits{accept}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
 @{$bits{add}}{1,0} = ($bf[1], $bf[1]);
 $bits{aeach}{0} = $bf[0];
-@{$bits{aelem}}{6,5,1,0} = ($bf[7], $bf[7], $bf[1], $bf[1]);
+@{$bits{aelem}}{6,5,1,0} = ($bf[6], $bf[6], $bf[1], $bf[1]);
 @{$bits{aelemfast}}{7,6,5,4,3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5]);
 @{$bits{aelemfast_lex}}{7,6,5,4,3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5], $bf[5]);
 $bits{akeys}{0} = $bf[0];
@@ -277,7 +277,7 @@ $bits{each}{0} = $bf[0];
 @{$bits{entereval}}{5,4,3,2,1,0} = ('OPpEVAL_RE_REPARSING', 'OPpEVAL_COPHH', 'OPpEVAL_BYTES', 'OPpEVAL_UNICODE', 'OPpEVAL_HAS_HH', $bf[0]);
 $bits{entergiven}{0} = $bf[0];
 $bits{enteriter}{3} = 'OPpITER_DEF';
-@{$bits{entersub}}{6,5,0} = ($bf[7], $bf[7], 'OPpENTERSUB_INARGS');
+@{$bits{entersub}}{6,5,0} = ($bf[6], $bf[6], 'OPpENTERSUB_INARGS');
 $bits{entertry}{0} = $bf[0];
 $bits{enterwhen}{0} = $bf[0];
 @{$bits{enterwrite}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
@@ -347,7 +347,7 @@ $bits{grepwhile}{0} = $bf[0];
 @{$bits{gsockopt}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
 @{$bits{gt}}{1,0} = ($bf[1], $bf[1]);
 $bits{gv}{5} = 'OPpEARLY_CV';
-@{$bits{helem}}{6,5,1,0} = ($bf[7], $bf[7], $bf[1], $bf[1]);
+@{$bits{helem}}{6,5,1,0} = ($bf[6], $bf[6], $bf[1], $bf[1]);
 $bits{hex}{0} = $bf[0];
 @{$bits{i_add}}{1,0} = ($bf[1], $bf[1]);
 @{$bits{i_divide}}{1,0} = ($bf[1], $bf[1]);
@@ -394,7 +394,7 @@ $bits{log}{0} = $bf[0];
 @{$bits{lslice}}{1,0} = ($bf[1], $bf[1]);
 $bits{lstat}{0} = $bf[0];
 @{$bits{lt}}{1,0} = ($bf[1], $bf[1]);
-@{$bits{lvref}}{4,3,0} = ($bf[6], $bf[6], $bf[0]);
+@{$bits{lvref}}{6,5,0} = ($bf[7], $bf[7], $bf[0]);
 $bits{mapwhile}{0} = $bf[0];
 $bits{method}{0} = $bf[0];
 $bits{method_named}{0} = $bf[0];
@@ -419,7 +419,7 @@ $bits{orassign}{0} = $bf[0];
 $bits{ord}{0} = $bf[0];
 @{$bits{pack}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
 @{$bits{padrange}}{6,5,4,3,2,1,0} = ($bf[4], $bf[4], $bf[4], $bf[4], $bf[4], $bf[4], $bf[4]);
-@{$bits{padsv}}{6,5} = ($bf[7], $bf[7]);
+@{$bits{padsv}}{6,5} = ($bf[6], $bf[6]);
 @{$bits{pipe_op}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
 $bits{pop}{0} = $bf[0];
 $bits{pos}{0} = $bf[0];
@@ -441,7 +441,7 @@ $bits{readlink}{0} = $bf[0];
 @{$bits{recv}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
 $bits{redo}{0} = $bf[0];
 $bits{ref}{0} = $bf[0];
-@{$bits{refassign}}{4,3,1,0} = ($bf[6], $bf[6], $bf[1], $bf[1]);
+@{$bits{refassign}}{6,5,1,0} = ($bf[7], $bf[7], $bf[1], $bf[1]);
 $bits{refgen}{0} = $bf[0];
 $bits{regcmaybe}{0} = $bf[0];
 $bits{regcomp}{0} = $bf[0];
@@ -458,9 +458,9 @@ $bits{rkeys}{0} = $bf[0];
 $bits{rmdir}{0} = $bf[0];
 $bits{rv2av}{0} = $bf[0];
 @{$bits{rv2cv}}{7,6,0} = ('OPpENTERSUB_NOPAREN', 'OPpMAY_RETURN_CONSTANT', $bf[0]);
-@{$bits{rv2gv}}{6,5,4,2,0} = ($bf[7], $bf[7], 'OPpALLOW_FAKE', 'OPpDONT_INIT_GV', $bf[0]);
+@{$bits{rv2gv}}{6,5,4,2,0} = ($bf[6], $bf[6], 'OPpALLOW_FAKE', 'OPpDONT_INIT_GV', $bf[0]);
 $bits{rv2hv}{0} = $bf[0];
-@{$bits{rv2sv}}{6,5,0} = ($bf[7], $bf[7], $bf[0]);
+@{$bits{rv2sv}}{6,5,0} = ($bf[6], $bf[6], $bf[0]);
 $bits{rvalues}{0} = $bf[0];
 @{$bits{sassign}}{7,6,1,0} = ('OPpASSIGN_CV_TO_GV', 'OPpASSIGN_BACKWARDS', $bf[1], $bf[1]);
 $bits{scalar}{0} = $bf[0];
@@ -591,12 +591,12 @@ our %defines = (
     OPpLVALUE                => 128,
     OPpLVAL_DEFER            =>  16,
     OPpLVAL_INTRO            => 128,
-    OPpLVREF_AV              =>   8,
-    OPpLVREF_CV              =>  24,
+    OPpLVREF_AV              =>  32,
+    OPpLVREF_CV              =>  96,
     OPpLVREF_ELEM            =>   4,
-    OPpLVREF_HV              =>  16,
+    OPpLVREF_HV              =>  64,
     OPpLVREF_SV              =>   0,
-    OPpLVREF_TYPE            =>  24,
+    OPpLVREF_TYPE            =>  96,
     OPpMAYBE_LVSUB           =>   8,
     OPpMAYBE_TRUEBOOL        =>  64,
     OPpMAY_RETURN_CONSTANT   =>  64,
index cc6e2d9..5845dcb 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -2158,7 +2158,6 @@ END_EXTERN_C
 #define OPpEVAL_BYTES           0x08
 #define OPpFT_STACKING          0x08
 #define OPpITER_DEF             0x08
-#define OPpLVREF_AV             0x08
 #define OPpMAYBE_LVSUB          0x08
 #define OPpREVERSE_INPLACE      0x08
 #define OPpSORT_INPLACE         0x08
@@ -2170,19 +2169,17 @@ END_EXTERN_C
 #define OPpEVAL_COPHH           0x10
 #define OPpFT_AFTER_t           0x10
 #define OPpLVAL_DEFER           0x10
-#define OPpLVREF_HV             0x10
 #define OPpOPEN_IN_RAW          0x10
 #define OPpOUR_INTRO            0x10
 #define OPpPAD_STATE            0x10
 #define OPpSORT_DESCEND         0x10
 #define OPpSUBSTR_REPL_FIRST    0x10
 #define OPpTARGET_MY            0x10
-#define OPpLVREF_CV             0x18
-#define OPpLVREF_TYPE           0x18
 #define OPpDEREF_AV             0x20
 #define OPpEARLY_CV             0x20
 #define OPpEVAL_RE_REPARSING    0x20
 #define OPpHUSH_VMSISH          0x20
+#define OPpLVREF_AV             0x20
 #define OPpOPEN_IN_CRLF         0x20
 #define OPpSORT_QSORT           0x20
 #define OPpTRANS_COMPLEMENT     0x20
@@ -2196,6 +2193,7 @@ END_EXTERN_C
 #define OPpFLIP_LINENUM         0x40
 #define OPpHINT_M_VMSISH_STATUS 0x40
 #define OPpLIST_GUESSED         0x40
+#define OPpLVREF_HV             0x40
 #define OPpMAYBE_TRUEBOOL       0x40
 #define OPpMAY_RETURN_CONSTANT  0x40
 #define OPpOPEN_OUT_RAW         0x40
@@ -2207,6 +2205,8 @@ END_EXTERN_C
 #define OPpTRANS_GROWS          0x40
 #define OPpDEREF                0x60
 #define OPpDEREF_SV             0x60
+#define OPpLVREF_CV             0x60
+#define OPpLVREF_TYPE           0x60
 #define OPpPADRANGE_COUNTMASK   0x7f
 #define OPpASSIGN_CV_TO_GV      0x80
 #define OPpCOREARGS_PUSHMARK    0x80
@@ -2348,8 +2348,8 @@ EXTCONST I16 PL_op_private_bitfields[] = {
     0, 8, -1,
     0, 8, -1,
     0, 8, -1,
-    3, -1, 0, 476, 1, 26, 2, 250, 3, 83, -1,
     5, -1, 1, 130, 2, 137, 3, 144, -1,
+    5, -1, 0, 476, 1, 26, 2, 250, 3, 83, -1,
 
 };
 
@@ -2765,12 +2765,12 @@ EXTCONST U16  PL_op_private_bitdefs[] = {
     /* gvsv          */ 0x277c, 0x2c91,
     /* gv            */ 0x12f5,
     /* gelem         */ 0x0067,
-    /* padsv         */ 0x277c, 0x03ba, 0x3971,
+    /* padsv         */ 0x277c, 0x025a, 0x3971,
     /* padav         */ 0x277c, 0x3970, 0x286c, 0x3669,
     /* padhv         */ 0x277c, 0x05d8, 0x0534, 0x3970, 0x286c, 0x3669,
     /* pushre        */ 0x3439,
-    /* rv2gv         */ 0x277c, 0x03ba, 0x1590, 0x286c, 0x2a68, 0x3a24, 0x0003,
-    /* rv2sv         */ 0x277c, 0x03ba, 0x2c90, 0x3a24, 0x0003,
+    /* rv2gv         */ 0x277c, 0x025a, 0x1590, 0x286c, 0x2a68, 0x3a24, 0x0003,
+    /* rv2sv         */ 0x277c, 0x025a, 0x2c90, 0x3a24, 0x0003,
     /* av2arylen     */ 0x286c, 0x0003,
     /* rv2cv         */ 0x29dc, 0x08f8, 0x0b90, 0x028c, 0x3be8, 0x3a24, 0x0003,
     /* prototype     */ 0x0003,
@@ -2883,7 +2883,7 @@ EXTCONST U16  PL_op_private_bitdefs[] = {
     /* rv2av         */ 0x277c, 0x2c90, 0x286c, 0x3668, 0x3a24, 0x0003,
     /* aelemfast     */ 0x01ff,
     /* aelemfast_lex */ 0x01ff,
-    /* aelem         */ 0x277c, 0x03ba, 0x2670, 0x286c, 0x0067,
+    /* aelem         */ 0x277c, 0x025a, 0x2670, 0x286c, 0x0067,
     /* aslice        */ 0x277c, 0x286c, 0x3669,
     /* kvaslice      */ 0x286d,
     /* aeach         */ 0x0003,
@@ -2895,7 +2895,7 @@ EXTCONST U16  PL_op_private_bitdefs[] = {
     /* delete        */ 0x277c, 0x35b8, 0x0003,
     /* exists        */ 0x3b18, 0x0003,
     /* rv2hv         */ 0x277c, 0x05d8, 0x0534, 0x2c90, 0x286c, 0x3668, 0x3a24, 0x0003,
-    /* helem         */ 0x277c, 0x03ba, 0x2670, 0x286c, 0x0067,
+    /* helem         */ 0x277c, 0x025a, 0x2670, 0x286c, 0x0067,
     /* hslice        */ 0x277c, 0x286c, 0x3669,
     /* kvhslice      */ 0x286d,
     /* unpack        */ 0x012f,
@@ -2929,7 +2929,7 @@ EXTCONST U16  PL_op_private_bitdefs[] = {
     /* orassign      */ 0x0003,
     /* dorassign     */ 0x0003,
     /* method        */ 0x0003,
-    /* entersub      */ 0x277c, 0x03ba, 0x0b90, 0x028c, 0x3be8, 0x3a24, 0x2141,
+    /* entersub      */ 0x277c, 0x025a, 0x0b90, 0x028c, 0x3be8, 0x3a24, 0x2141,
     /* leavesub      */ 0x2ff8, 0x0003,
     /* leavesublv    */ 0x2ff8, 0x0003,
     /* caller        */ 0x00bc, 0x012f,
@@ -3098,8 +3098,8 @@ EXTCONST U16  PL_op_private_bitdefs[] = {
     /* runcv         */ 0x00bd,
     /* fc            */ 0x0003,
     /* padrange      */ 0x277c, 0x019b,
-    /* refassign     */ 0x277c, 0x0252, 0x13e8, 0x0067,
-    /* lvref         */ 0x277c, 0x0252, 0x13e8, 0x0003,
+    /* refassign     */ 0x277c, 0x037a, 0x13e8, 0x0067,
+    /* lvref         */ 0x277c, 0x037a, 0x13e8, 0x0003,
     /* lvrefslice    */ 0x277d,
 
 };
index d4a86d6..918a7fe 100644 (file)
@@ -717,9 +717,10 @@ addbits('split', 7 => qw(OPpSPLIT_IMPLIM IMPLIM)); # implicit limit
 
 
 
+# OPpLVREF_TYPE must not conflict with generic magic flags in mg.h.
 addbits($_,
     2 => qw(OPpLVREF_ELEM ELEM   ),
-'3..4'=> {
+'5..6'=> {
            mask_def => 'OPpLVREF_TYPE',
            enum     => [ qw(
                              0   OPpLVREF_SV   SV