diff options
author | Stephen McCamant <smcc@mit.edu> | 2001-01-13 19:00:13 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-15 13:02:38 +0000 |
commit | 117dada22e1a48990acd498dee229f361feda1fa (patch) | |
tree | 3525af71c58aea698d075ed94da359307434b2f1 /op.c | |
parent | 9d96b2e75ff1733e38cb57edc6d33908d11ecd49 (diff) | |
download | perl-117dada22e1a48990acd498dee229f361feda1fa.tar.gz |
[PATCH @8436] Eliminate op_children
Date: Sun, 14 Jan 2001 03:00:13 -0800 (PST)
Message-ID: <14945.32919.44271.685122@soda.csua.berkeley.edu>
Subject: [PATCH @8436] Re: Eliminate op_children
From: Stephen McCamant <smcc@CSUA.Berkeley.EDU>
Date: Sun, 14 Jan 2001 03:23:56 -0800 (PST)
Message-ID: <14945.35680.571387.810763@soda.csua.berkeley.edu>
p4raw-id: //depot/perl@8442
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -2410,13 +2410,6 @@ Perl_convert(pTHX_ I32 type, I32 flags, OP *o) if (o->op_type != type) return o; - if (cLISTOPo->op_children < 7) { - /* XXX do we really need to do this if we're done appending?? */ - for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) - last = kid; - cLISTOPo->op_last = last; /* in case check substituted last arg */ - } - return fold_constants(o); } @@ -2444,7 +2437,6 @@ Perl_append_elem(pTHX_ I32 type, OP *first, OP *last) ((LISTOP*)first)->op_first = last; } ((LISTOP*)first)->op_last = last; - ((LISTOP*)first)->op_children++; return first; } @@ -2465,9 +2457,7 @@ Perl_append_list(pTHX_ I32 type, LISTOP *first, LISTOP *last) first->op_last->op_sibling = last->op_first; first->op_last = last->op_last; - first->op_children += last->op_children; - if (first->op_children) - first->op_flags |= OPf_KIDS; + first->op_flags |= (last->op_flags & OPf_KIDS); #ifdef PL_OP_SLAB_ALLOC #else @@ -2500,7 +2490,7 @@ Perl_prepend_elem(pTHX_ I32 type, OP *first, OP *last) first->op_sibling = ((LISTOP*)last)->op_first; ((LISTOP*)last)->op_first = first; } - ((LISTOP*)last)->op_children++; + last->op_flags |= OPf_KIDS; return last; } @@ -2533,7 +2523,8 @@ Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP *first, OP *last) listop->op_type = type; listop->op_ppaddr = PL_ppaddr[type]; - listop->op_children = (first != 0) + (last != 0); + if (first || last) + flags |= OPf_KIDS; listop->op_flags = flags; if (!last && first) @@ -2553,8 +2544,6 @@ Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP *first, OP *last) if (!last) listop->op_last = pushop; } - else if (listop->op_children) - listop->op_flags |= OPf_KIDS; return (OP*)listop; } @@ -6309,7 +6298,6 @@ S_simplify_sort(pTHX_ OP *o) kid = cLISTOPo->op_first->op_sibling; cLISTOPo->op_first->op_sibling = kid->op_sibling; /* bypass old block */ op_free(kid); /* then delete it */ - cLISTOPo->op_children--; } OP * |