From: Nicholas Clark Date: Tue, 8 Jan 2008 17:55:41 +0000 (+0000) Subject: With regexps stored as real RVs, we can eliminate SvREPADTMP(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86d2c25d57d36407551f0841eab018075f2188bf;p=p5sagit%2Fp5-mst-13.2.git With regexps stored as real RVs, we can eliminate SvREPADTMP(). Exterminate! Exterminate! Exterminate! p4raw-id: //depot/perl@32902 --- diff --git a/op.c b/op.c index 2423bf0..d838325 100644 --- a/op.c +++ b/op.c @@ -627,7 +627,6 @@ clear_pmop: av_push((AV*) PL_regex_pad[0], (SV*) SvREFCNT_inc_simple_NN(PL_regex_pad[(cPMOPo)->op_pmoffset])); SvREADONLY_off(PL_regex_pad[(cPMOPo)->op_pmoffset]); - SvREPADTMP_on(PL_regex_pad[(cPMOPo)->op_pmoffset]); PM_SETRE_OFFSET(cPMOPo, (cPMOPo)->op_pmoffset); } #else @@ -3370,7 +3369,6 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags) if (av_len((AV*) PL_regex_pad[0]) > -1) { SV * const repointer = av_pop((AV*)PL_regex_pad[0]); pmop->op_pmoffset = SvIV(repointer); - SvREPADTMP_off(repointer); sv_setiv(repointer,0); } else { SV * const repointer = newSViv(0); diff --git a/perl.c b/perl.c index e57356b..88448de 100644 --- a/perl.c +++ b/perl.c @@ -887,9 +887,6 @@ perl_destruct(pTHXx) /* So stop it pointing to what is now a dead reference. */ SvROK_off(resv); } - else if(SvREPADTMP(resv)) { - SvREPADTMP_off(resv); - } } } SvREFCNT_dec(PL_regex_padav); diff --git a/sv.h b/sv.h index c80c2aa..1d7555f 100644 --- a/sv.h +++ b/sv.h @@ -328,12 +328,10 @@ perform the upgrade if necessary. See C. 3: For PVCV, whether CvUNIQUE(cv) refers to an eval or once only [CvEVAL(cv), CvSPECIAL(cv)] - 4: Whether the regexp pointer is in - fact an offset [SvREPADTMP(sv)] - 5: On a pad name SV, that slot in the + 4: On a pad name SV, that slot in the frame AV is a REFCNT'ed reference to a lexical from "outside". */ -#define SVphv_REHASH SVf_FAKE /* 6: On a PVHV, hash values are being +#define SVphv_REHASH SVf_FAKE /* 5: On a PVHV, hash values are being recalculated */ #define SVf_OOK 0x02000000 /* has valid offset value. For a PVHV this means that a hv_aux struct is present @@ -990,14 +988,6 @@ the scalar's value cannot change unless written to. #define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL) -#ifdef USE_ITHREADS -/* The following uses the FAKE flag to show that a regex pointer is infact - its own offset in the regexpad for ithreads */ -#define SvREPADTMP(sv) (SvFLAGS(sv) & SVf_FAKE) -#define SvREPADTMP_on(sv) (SvFLAGS(sv) |= SVf_FAKE) -#define SvREPADTMP_off(sv) (SvFLAGS(sv) &= ~SVf_FAKE) -#endif - #define SvPAD_TYPED(sv) \ ((SvFLAGS(sv) & (SVpad_NAME|SVpad_TYPED)) == (SVpad_NAME|SVpad_TYPED))