diff options
-rw-r--r-- | dump.c | 5 | ||||
-rw-r--r-- | inline.h | 12 | ||||
-rw-r--r-- | op.c | 6 | ||||
-rw-r--r-- | pad.c | 12 | ||||
-rw-r--r-- | scope.c | 2 | ||||
-rw-r--r-- | sv.h | 8 |
6 files changed, 13 insertions, 32 deletions
@@ -1429,13 +1429,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo if (!((flags & SVpad_NAME) == SVpad_NAME && (type == SVt_PVMG || type == SVt_PVNV))) { - if ((flags & SVs_PADMY) && (flags & SVs_PADSTALE)) + if ((flags & SVs_PADSTALE)) sv_catpv(d, "PADSTALE,"); } if (!((flags & SVpad_NAME) == SVpad_NAME && type == SVt_PVMG)) { - if (!(flags & SVs_PADMY) && (flags & SVs_PADTMP)) + if ((flags & SVs_PADTMP)) sv_catpv(d, "PADTMP,"); - if (flags & SVs_PADMY) sv_catpv(d, "PADMY,"); } append_flags(d, flags, first_sv_flags_names); if (flags & SVf_ROK) { @@ -156,18 +156,6 @@ SvAMAGIC_off(SV *sv) } PERL_STATIC_INLINE U32 -S_SvPADTMP_on(SV *sv) -{ - assert(!(SvFLAGS(sv) & SVs_PADMY)); - return SvFLAGS(sv) |= SVs_PADTMP; -} -PERL_STATIC_INLINE U32 -S_SvPADTMP_off(SV *sv) -{ - assert(!(SvFLAGS(sv) & SVs_PADMY)); - return SvFLAGS(sv) &= ~SVs_PADTMP; -} -PERL_STATIC_INLINE U32 S_SvPADSTALE_on(SV *sv) { assert(!(SvFLAGS(sv) & SVs_PADTMP)); @@ -6367,7 +6367,6 @@ Perl_newRANGE(pTHX_ I32 flags, OP *left, OP *right) sv_upgrade(PAD_SV(range->op_targ), SVt_PVNV); flip->op_targ = pad_add_name_pvn("$", 1, padadd_NO_DUP_CHECK, 0, 0);; sv_upgrade(PAD_SV(flip->op_targ), SVt_PVNV); - SvFLAGS(PAD_SV(flip->op_targ)) &=~ SVs_PADMY; SvPADTMP_on(PAD_SV(flip->op_targ)); flip->op_private = left->op_type == OP_CONST ? OPpFLIP_LINENUM : 0; @@ -7415,7 +7414,7 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) } if (const_sv) { SvREFCNT_inc_simple_void_NN(const_sv); - SvFLAGS(const_sv) = (SvFLAGS(const_sv) & ~SVs_PADMY) | SVs_PADTMP; + SvFLAGS(const_sv) |= SVs_PADTMP; if (cv) { assert(!CvROOT(cv) && !CvCONST(cv)); cv_forget_slab(cv); @@ -7607,7 +7606,6 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) else *spot = cv_clone(clonee); SvREFCNT_dec_NN(clonee); cv = *spot; - SvPADMY_on(cv); } if (CvDEPTH(outcv) && !reusable && PadnameIsSTATE(name)) { PADOFFSET depth = CvDEPTH(outcv); @@ -7837,7 +7835,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, } if (const_sv) { SvREFCNT_inc_simple_void_NN(const_sv); - SvFLAGS(const_sv) = (SvFLAGS(const_sv) & ~SVs_PADMY) | SVs_PADTMP; + SvFLAGS(const_sv) |= SVs_PADTMP; if (cv) { assert(!CvROOT(cv) && !CvCONST(cv)); cv_forget_slab(cv); @@ -769,9 +769,9 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype) sv = *av_fetch(PL_comppad, retval, TRUE); if (!(SvFLAGS(sv) & #ifdef USE_PAD_RESET - (SVs_PADMY|(konst ? SVs_PADTMP : 0)) + (konst ? SVs_PADTMP : 0)) #else - (SVs_PADMY|SVs_PADTMP) + SVs_PADTMP #endif )) break; @@ -840,7 +840,6 @@ Perl_pad_add_anon(pTHX_ CV* func, I32 optype) assert (SvTYPE(func) == SVt_PVFM); av_store(PL_comppad, ix, rv); } - SvPADMY_on((SV*)func); /* to avoid ref loops, we never have parent + child referencing each * other simultaneously */ @@ -2122,7 +2121,6 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, bool newcv) sv = MUTABLE_SV(newHV()); else sv = newSV(0); - SvPADMY_on(sv); /* reset the 'assign only once' flag on each state var */ if (sigil != '&' && SvPAD_STATE(namesv)) SvPADSTALE_on(sv); @@ -2387,7 +2385,6 @@ Perl_pad_push(pTHX_ PADLIST *padlist, int depth) if (SvPADTMP(oldpad[ix])) SvPADTMP_on(sv); } av_store(newpad, ix, sv); - SvPADMY_on(sv); } } else if (PadnamePV(names[ix])) { @@ -2522,7 +2519,6 @@ Perl_padlist_dup(pTHX_ PADLIST *srcpad, CLONE_PARAMS *param) else sv = newSV(0); pad1a[ix] = sv; - SvPADMY_on(sv); } } } @@ -2538,9 +2534,7 @@ Perl_padlist_dup(pTHX_ PADLIST *srcpad, CLONE_PARAMS *param) /* SvREFCNT(oldpad[ix]) != 1 for some code in threads.xs FIXTHAT before merging this branch. (And I know how to) */ - if (SvPADMY(oldpad[ix])) - SvPADMY_on(sv); - else + if (SvPADTMP(oldpad[ix])) SvPADTMP_on(sv); } } @@ -1076,7 +1076,7 @@ Perl_leave_scope(pTHX_ I32 base) SvREFCNT_dec_NN(sv); /* Cast current value to the winds. */ /* preserve pad nature, but also mark as not live * for any closure capturing */ - SvFLAGS(*svp) |= (SVs_PADMY|SVs_PADSTALE); + SvFLAGS(*svp) |= SVs_PADSTALE; } } break; @@ -1052,13 +1052,15 @@ sv_force_normal does nothing. #define SVs_PADMY 0 #define SvPADMY(sv) !(SvFLAGS(sv) & SVs_PADTMP) -#define SvPADMY_on(sv) SvPADTMP_off(sv) +#ifndef PERL_CORE +# define SvPADMY_on(sv) SvPADTMP_off(sv) +#endif #define SvPADTMP(sv) (SvFLAGS(sv) & (SVs_PADTMP)) #define SvPADSTALE(sv) (SvFLAGS(sv) & (SVs_PADSTALE)) -#define SvPADTMP_on(sv) S_SvPADTMP_on(MUTABLE_SV(sv)) -#define SvPADTMP_off(sv) S_SvPADTMP_off(MUTABLE_SV(sv)) +#define SvPADTMP_on(sv) (SvFLAGS(sv) |= SVs_PADTMP) +#define SvPADTMP_off(sv) (SvFLAGS(sv) &= ~SVs_PADTMP) #define SvPADSTALE_on(sv) S_SvPADSTALE_on(MUTABLE_SV(sv)) #define SvPADSTALE_off(sv) S_SvPADSTALE_off(MUTABLE_SV(sv)) |