This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove @experimental from regen/feature.pl
[perl5.git] / regen / op_private
index 68286a6..c8b9652 100644 (file)
@@ -35,6 +35,7 @@ bit bit field. Here's a general example:
 
     addbits('aelem',
             7 => qw(OPpLVAL_INTRO LVINTRO),
+            6 => qw(OPpLVAL_DEFER LVDEFER),
        '4..5' =>  {
                        mask_def  => 'OPpDEREF',
                        enum => [ qw(
@@ -43,10 +44,9 @@ bit bit field. Here's a general example:
                                    3   OPpDEREF_SV   DREFSV
                                )],
                    },
-            6 => qw(OPpLVAL_DEFER LVDEFER),
     );
 
-Here for the op C<aelem>, bits 4 and 7 (bits are numbered 0..7) are
+Here for the op C<aelem>, bits 6 and 7 (bits are numbered 0..7) are
 defined as single-bit flags. The first string following the bit number is
 the define name that gets emitted in F<opcode.h>, and the second string is
 the label, which will be displayed by F<Concise.pm> and Perl_do_op_dump()
@@ -202,6 +202,9 @@ use strict;
 
     $args1{$_} = 1 for (
                         qw(reverse), # ck_fun(), but most bits stolen
+                        qw(mapstart grepstart), # set in ck_fun, but
+                                                # cleared in ck_grep,
+                                                # unless there is an error
                         grep !$maxarg{$_} && !$args0{$_},
                             ops_with_flag('1'), # UNOP
                             ops_with_flag('+'), # UNOP_AUX
@@ -335,7 +338,7 @@ addbits($_, 7 => qw(OPpLVAL_INTRO LVINTRO))
 #
 # pp.c pos substr each not OK (RETPUSHUNDEF)
 #      ref not OK (RETPUSHNO)
-#      trans not OK (dTARG; TARG = sv_newmortal();)
+#      trans not OK (target is used for lhs, not retval)
 #      ucfirst etc not OK: TMP arg processed inplace
 #      quotemeta not OK (unsafe when TARG == arg)
 #      pack - unknown whether it is safe
@@ -376,9 +379,6 @@ addbits($_, 7 => qw(OPpLVAL_INTRO LVINTRO))
 
 addbits($_, 4 => qw(OPpTARGET_MY TARGMY))
     for ops_with_flag('T'),
-    # This flag is also used to indicate matches against implicit $_,
-    # where $_ is lexical; e.g. my $_; ....; /foo/
-    qw(match subst trans transr);
 ;
 
 
@@ -437,7 +437,8 @@ addbits($_, 6 => qw(OPpOUR_INTRO OURINTR)) # Variable was in an our()
 # We might be an lvalue to return
 addbits($_, 3 => qw(OPpMAYBE_LVSUB LVSUB))
     for qw(aassign rv2av rv2gv rv2hv padav padhv aelem helem aslice hslice
-           av2arylen keys rkeys kvaslice kvhslice substr pos vec multideref);
+           av2arylen keys akeys kvaslice kvhslice substr pos vec
+           multideref);
 
 
 
@@ -474,14 +475,32 @@ addbits($_, 7 => qw(OPpPV_IS_UTF8 UTF)) for qw(last redo next goto dump);
 
 
 
+# note that for refassign, this bit can mean either OPpPAD_STATE or
+# OPpOUR_INTRO depending on the type of the LH child, .e.g.
+#   \our   $foo = ...
+#   \state $foo = ...
+
 addbits($_, 6 => qw(OPpPAD_STATE STATE))  for qw(padav padhv padsv lvavref
                                                  lvref refassign pushmark);
 
+# NB: both sassign and aassign use the 'OPpASSIGN' naming convention
+# for their private flags
+
+# there *may* be common scalar items on both sides of a list assign:
+# run-time checking will be needed.
+addbits('aassign', 6 => qw(OPpASSIGN_COMMON_SCALAR COM_SCALAR));
+#
+# as above, but it's possible to check for non-commonality with just
+# a SvREFCNT(lhs) == 1 test for each lhs element
+addbits('aassign', 5 => qw(OPpASSIGN_COMMON_RC1 COM_RC1));
 
+# run-time checking is required for an aggregate on the LHS
+addbits('aassign', 4 => qw(OPpASSIGN_COMMON_AGG COM_AGG));
 
-addbits('aassign', 6 => qw(OPpASSIGN_COMMON COMMON));
 
 
+# NB: both sassign and aassign use the 'OPpASSIGN' naming convention
+# for their private flags
 
 addbits('sassign',
     6 => qw(OPpASSIGN_BACKWARDS BKWARD), # Left & right switched
@@ -601,12 +620,13 @@ addbits('rv2gv',
 );
 
 
+# NB OPpITER_REVERSED must always be bit 1: see pp_iter()
 
 addbits('enteriter',
-                    2 => qw(OPpITER_REVERSED REVERSED),# for (reverse ...)
-                    3 => qw(OPpITER_DEF      DEF),     # 'for $_' or 'for my $_'
+                    1 => qw(OPpITER_REVERSED REVERSED),# for (reverse ...)
+                    3 => qw(OPpITER_DEF      DEF),     # 'for $_'
 );
-addbits('iter',     2 => qw(OPpITER_REVERSED REVERSED));
+addbits('iter',     1 => qw(OPpITER_REVERSED REVERSED));
 
 
 
@@ -688,11 +708,6 @@ for (grep { $_ !~ /^l?stat$/ } ops_with_flag('-')) {
 
 
 
-addbits($_, 1 => qw(OPpGREP_LEX GREPLEX)) # iterate over lexical $_
-    for qw(mapwhile mapstart grepwhile grepstart);
-
-
-
 addbits('entereval',
     1 => qw(OPpEVAL_HAS_HH       HAS_HH ), # Does it have a copy of %^H ?
     2 => qw(OPpEVAL_UNICODE      UNI    ),
@@ -732,6 +747,7 @@ addbits($_,
                              3   OPpLVREF_CV   CV
                          )],
          },
+   #6 => qw(OPpPAD_STATE STATE),
    #7 => qw(OPpLVAL_INTRO LVINTRO),
 ) for 'refassign', 'lvref';