addbits('aelem',
7 => qw(OPpLVAL_INTRO LVINTRO),
+ 6 => qw(OPpLVAL_DEFER LVDEFER),
'4..5' => {
mask_def => 'OPpDEREF',
enum => [ qw(
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()
$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
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);
;
# 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);
+# 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
);
+# 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));
-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 ),
3 OPpLVREF_CV CV
)],
},
+ #6 => qw(OPpPAD_STATE STATE),
#7 => qw(OPpLVAL_INTRO LVINTRO),
) for 'refassign', 'lvref';