if (o->op_savefree) sv_catpvs(tmpsv, ",SAVEFREE");
if (o->op_static) sv_catpvs(tmpsv, ",STATIC");
if (o->op_folded) sv_catpvs(tmpsv, ",FOLDED");
- if (o->op_lastsib) sv_catpvs(tmpsv, ",LASTSIB");
+ if (o->op_moresib) sv_catpvs(tmpsv, ",MORESIB");
Perl_dump_indent(aTHX_ level, file, "FLAGS = (%s)\n",
SvCUR(tmpsv) ? SvPVX_const(tmpsv) + 1 : "");
}
# walkoptree comes from B.xs
BEGIN {
- $B::VERSION = '1.57';
+ $B::VERSION = '1.58';
@B::EXPORT_OK = ();
# Our BOOT code needs $VERSION set, and will append to @EXPORT_OK.
{ STR_WITH_LEN("static"), op_offset_special, 0, },/*49*/
# if PERL_VERSION >= 19
{ STR_WITH_LEN("folded"), op_offset_special, 0, },/*50*/
- { STR_WITH_LEN("lastsib"), op_offset_special, 0, },/*51*/
+ { STR_WITH_LEN("moresib"), op_offset_special, 0, },/*51*/
{ STR_WITH_LEN("parent"), op_offset_special, 0, },/*52*/
# endif
#endif
B::OP::savefree = 48
B::OP::static = 49
B::OP::folded = 50
- B::OP::lastsib = 51
+ B::OP::moresib = 51
B::OP::parent = 52
B::METHOP::first = 53
B::METHOP::meth_sv = 54
case 49: /* B::OP::static */
#if PERL_VERSION >= 19
case 50: /* B::OP::folded */
- case 51: /* B::OP::lastsib */
+ case 51: /* B::OP::moresib */
#endif
#endif
/* These are all bitfields, so we can't take their addresses */
: ix == 48 ? o->op_savefree
: ix == 49 ? o->op_static
: ix == 50 ? o->op_folded
- : ix == 51 ? o->op_lastsib
+ : ix == 51 ? o->op_moresib
: o->op_spare)));
break;
case 33: /* B::LISTOP::children */
my $first = $lineseq->first;
my $second = $first->sibling;
is(ref $second->sibling, "B::NULL", 'op_parent: second sibling is null');
- is($first->lastsib, 0 , 'op_parent: first sibling: !lastsib');
- is($second->lastsib, 1, 'op_parent: second sibling: lastsib');
+ is($first->moresib, 1 , 'op_parent: first sibling: moresib');
+ is($second->moresib, 0, 'op_parent: second sibling: !moresib');
is($$lineseq, ${$first->parent}, 'op_parent: first sibling okay');
is($$lineseq, ${$second->parent}, 'op_parent: second sibling okay');
}
{
1 TYPE = leave ===> NULL
TARG = 1
- FLAGS = (VOID,KIDS,PARENS,SLABBED,LASTSIB)
+ FLAGS = (VOID,KIDS,PARENS,SLABBED)
PRIVATE = (REFC)
REFCNT = 1
{
2 TYPE = enter ===> 3
- FLAGS = (UNKNOWN,SLABBED)
+ FLAGS = (UNKNOWN,SLABBED,MORESIB)
}
{
3 TYPE = nextstate ===> 4
- FLAGS = (VOID,SLABBED)
+ FLAGS = (VOID,SLABBED,MORESIB)
LINE = 1
PACKAGE = "t"
}
{
5 TYPE = entersub ===> 1
TARG = 1
- FLAGS = (VOID,KIDS,STACKED,SLABBED,LASTSIB)
+ FLAGS = (VOID,KIDS,STACKED,SLABBED)
PRIVATE = (TARG)
{
6 TYPE = null ===> (5)
(was list)
- FLAGS = (UNKNOWN,KIDS,SLABBED,LASTSIB)
+ FLAGS = (UNKNOWN,KIDS,SLABBED)
{
4 TYPE = pushmark ===> 7
- FLAGS = (SCALAR,SLABBED)
+ FLAGS = (SCALAR,SLABBED,MORESIB)
}
{
8 TYPE = null ===> (6)
(was rv2cv)
- FLAGS = (SCALAR,KIDS,SLABBED,LASTSIB)
+ FLAGS = (SCALAR,KIDS,SLABBED)
PRIVATE = (0x1)
{
7 TYPE = gv ===> 5
- FLAGS = (SCALAR,SLABBED,LASTSIB)
+ FLAGS = (SCALAR,SLABBED)
GV_OR_PADIX
}
}
DEBUG_S_warn((aTHX_ "allocating op at %p, slab %p", (void*)o, (void*)slab));
gotit:
- /* lastsib == 1, op_sibparent == 0 implies a solitary unattached op */
- o->op_lastsib = 1;
#ifdef PERL_OP_PARENT
+ /* moresib == 0, op_sibling == 0 implies a solitary unattached op */
+ assert(!o->op_moresib);
assert(!o->op_sibparent);
#endif
more different nodes. Performs the necessary op_first/op_last
housekeeping on the parent node and op_sibling manipulation on the
children. The last deleted node will be marked as as the last node by
-updating the op_sibling/op_sibparent or op_lastsib field as appropriate.
+updating the op_sibling/op_sibparent or op_moresib field as appropriate.
Note that op_next is not manipulated, and nodes are not freed; that is the
responsibility of the caller. It also won't create a new list op for an
last_del = OpSIBLING(last_del);
rest = OpSIBLING(last_del);
OpSIBLING_set(last_del, NULL);
- last_del->op_lastsib = 1;
+ last_del->op_moresib = 0;
}
else
rest = first;
while (OpHAS_SIBLING(last_ins))
last_ins = OpSIBLING(last_ins);
OpSIBLING_set(last_ins, rest);
- last_ins->op_lastsib = rest ? 0 : 1;
+ last_ins->op_moresib = rest ? 1 : 0;
}
else
insert = rest;
if (start) {
OpSIBLING_set(start, insert);
- start->op_lastsib = insert ? 0 : 1;
+ start->op_moresib = insert ? 1 : 0;
}
else {
cLISTOPx(parent)->op_first = insert;
cLISTOPx(parent)->op_last = lastop;
if (lastop) {
- lastop->op_lastsib = 1;
+ lastop->op_moresib = 0;
#ifdef PERL_OP_PARENT
lastop->op_sibparent = parent;
#endif
while (kid && OpHAS_SIBLING(kid))
kid = OpSIBLING(kid);
if (kid) {
- kid->op_lastsib = 1;
+ kid->op_moresib = 0;
#ifdef PERL_OP_PARENT
kid->op_sibparent = (OP*)logop;
#endif
if (last->op_type != (unsigned)type)
return op_append_elem(type, first, last);
- ((LISTOP*)first)->op_last->op_lastsib = 0;
+ ((LISTOP*)first)->op_last->op_moresib = 1;
OpSIBLING_set(((LISTOP*)first)->op_last, ((LISTOP*)last)->op_first);
((LISTOP*)first)->op_last = ((LISTOP*)last)->op_last;
- ((LISTOP*)first)->op_last->op_lastsib = 1;
+ ((LISTOP*)first)->op_last->op_moresib = 0;
#ifdef PERL_OP_PARENT
((LISTOP*)first)->op_last->op_sibparent = first;
#endif
/* manually detach any siblings then add them back later */
rest = OpSIBLING(o);
OpSIBLING_set(o, NULL);
- o->op_lastsib = 1;
+ o->op_moresib = 0;
}
o = newLISTOP(OP_LIST, 0, o, NULL);
if (rest)
listop->op_last = last;
if (type == OP_LIST) {
OP* const pushop = newOP(OP_PUSHMARK, 0);
- pushop->op_lastsib = 0;
+ pushop->op_moresib = 1;
OpSIBLING_set(pushop, first);
listop->op_first = pushop;
listop->op_flags |= OPf_KIDS;
listop->op_last = pushop;
}
if (first)
- first->op_lastsib = 0;
+ first->op_moresib = 1;
if (listop->op_last) {
- listop->op_last->op_lastsib = 1;
+ listop->op_last->op_moresib = 0;
#ifdef PERL_OP_PARENT
listop->op_last->op_sibparent = (OP*)listop;
#endif
else {
binop->op_private = (U8)(2 | (flags >> 8));
OpSIBLING_set(first, last);
- first->op_lastsib = 0;
+ first->op_moresib = 1;
}
#ifdef PERL_OP_PARENT
OpSIBLING_set(o, newop);
OpSIBLING_set(newop, ns3);
- newop->op_lastsib = 0;
+ newop->op_moresib = 1;
newop->op_flags = (newop->op_flags & ~OPf_WANT) | OPf_WANT_VOID;
* !op_slabbed.
* op_savefree on savestack via SAVEFREEOP
* op_folded Result/remainder of a constant fold operation.
- * op_lastsib this op is is the last sibling
+ * op_moresib this op is is not the last sibling
* op_spare One spare bit
* op_flags Flags common to all operations. See OPf_* below.
* op_private Flags peculiar to a particular operation (BUT,
typedef PERL_BITFIELD16 Optype;
/* this field now either points to the next sibling or to the parent,
- * depending on op_lastsib. So rename it from op_sibling to op_sibparent.
+ * depending on op_moresib. So rename it from op_sibling to op_sibparent.
*/
#ifdef PERL_OP_PARENT
# define _OP_SIBPARENT_FIELDNAME op_sibparent
PERL_BITFIELD16 op_savefree:1; \
PERL_BITFIELD16 op_static:1; \
PERL_BITFIELD16 op_folded:1; \
- PERL_BITFIELD16 op_lastsib:1; \
+ PERL_BITFIELD16 op_moresib:1; \
PERL_BITFIELD16 op_spare:1; \
U8 op_flags; \
U8 op_private;
( (o) && OP_TYPE_ISNT_AND_WASNT_NN(o, type) )
#ifdef PERL_OP_PARENT
-# define OpHAS_SIBLING(o) (!cBOOL((o)->op_lastsib))
-# define OpSIBLING(o) (0 + (o)->op_lastsib ? NULL : (o)->op_sibparent)
+# define OpHAS_SIBLING(o) (cBOOL((o)->op_moresib))
+# define OpSIBLING(o) (0 + (o)->op_moresib ? (o)->op_sibparent : NULL)
# define OpSIBLING_set(o, sib) ((o)->op_sibparent = (sib))
#else
# define OpHAS_SIBLING(o) (cBOOL((o)->op_sibling))
Starting in version 5.21.2, perls built with the experimental
define C<-DPERL_OP_PARENT> add an extra boolean flag for each op,
-C<op_lastsib>. When set, this indicates that this is the last op in an
+C<op_moresib>. When not set, this indicates that this is the last op in an
C<OpSIBLING> chain. This frees up the C<op_sibling> field on the last
sibling to point back to the parent op. Under this build, that field is
also renamed C<op_sibparent> to reflect its joint role. The macro