From: Nicholas Clark Date: Mon, 13 Apr 2009 07:43:30 +0000 (+0100) Subject: GvUNIQUE* have been defined as 0 since 2005/06/30 - high time to remove them. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d32faaf3b401b4c02872bfb2f57e48e11b3a1d28;p=p5sagit%2Fp5-mst-13.2.git GvUNIQUE* have been defined as 0 since 2005/06/30 - high time to remove them. --- diff --git a/dump.c b/dump.c index 724baf8..edcfc46 100644 --- a/dump.c +++ b/dump.c @@ -1492,7 +1492,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo if (isGV_with_GP(sv)) { if (GvINTRO(sv)) sv_catpv(d, "INTRO,"); if (GvMULTI(sv)) sv_catpv(d, "MULTI,"); - if (GvUNIQUE(sv)) sv_catpv(d, "UNIQUE,"); if (GvASSUMECV(sv)) sv_catpv(d, "ASSUMECV,"); if (GvIN_PAD(sv)) sv_catpv(d, "IN_PAD,"); } diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs index 7a86cd7..f7eb6e0 100644 --- a/ext/attributes/attributes.xs +++ b/ext/attributes/attributes.xs @@ -131,12 +131,6 @@ usage: XPUSHs(newSVpvs_flags("lvalue", SVs_TEMP)); if (cvflags & CVf_METHOD) XPUSHs(newSVpvs_flags("method", SVs_TEMP)); - if (GvUNIQUE(CvGV((const CV *)sv))) - XPUSHs(newSVpvs_flags("unique", SVs_TEMP)); - break; - case SVt_PVGV: - if (isGV_with_GP(sv) && GvUNIQUE(sv)) - XPUSHs(newSVpvs_flags("unique", SVs_TEMP)); break; default: break; diff --git a/gv.c b/gv.c index 07f2ff9..c22f73a 100644 --- a/gv.c +++ b/gv.c @@ -103,11 +103,6 @@ Perl_gv_IOadd(pTHX_ register GV *gv) } if (!GvIOp(gv)) { -#ifdef GV_UNIQUE_CHECK - if (GvUNIQUE(gv)) { - Perl_croak(aTHX_ "Bad symbol for filehandle (GV is unique)"); - } -#endif GvIOp(gv) = newIO(); } return gv; diff --git a/gv.h b/gv.h index 85b0380..b58d235 100644 --- a/gv.h +++ b/gv.h @@ -166,16 +166,6 @@ Return the SV from the GV. #define GvIN_PAD_on(gv) (GvFLAGS(gv) |= GVf_IN_PAD) #define GvIN_PAD_off(gv) (GvFLAGS(gv) &= ~GVf_IN_PAD) -#define GvUNIQUE(gv) 0 -#define GvUNIQUE_on(gv) NOOP -#define GvUNIQUE_off(gv) NOOP - -#ifdef USE_ITHREADS -#define GV_UNIQUE_CHECK -#else -#undef GV_UNIQUE_CHECK -#endif - #ifndef PERL_CORE # define Nullgv Null(GV*) #endif diff --git a/op.c b/op.c index 89ed522..be98c3f 100644 --- a/op.c +++ b/op.c @@ -5588,12 +5588,6 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) cv = (!name || GvCVGEN(gv)) ? NULL : GvCV(gv); -#ifdef GV_UNIQUE_CHECK - if (cv && GvUNIQUE(gv) && SvREADONLY(cv)) { - Perl_croak(aTHX_ "Can't define subroutine %s (GV is unique)", name); - } -#endif - if (!block || !ps || *ps || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS) #ifdef PERL_MAD @@ -5607,12 +5601,6 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) if (cv) { const bool exists = CvROOT(cv) || CvXSUB(cv); -#ifdef GV_UNIQUE_CHECK - if (exists && GvUNIQUE(gv)) { - Perl_croak(aTHX_ "Can't redefine unique subroutine %s", name); - } -#endif - /* if the subroutine doesn't exist and wasn't pre-declared * with a prototype, assume it will be AUTOLOADed, * skipping the prototype check @@ -6155,11 +6143,6 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) ? gv_fetchsv(cSVOPo->op_sv, GV_ADD, SVt_PVFM) : gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVFM); -#ifdef GV_UNIQUE_CHECK - if (GvUNIQUE(gv)) { - Perl_croak(aTHX_ "Bad symbol for form (GV is unique)"); - } -#endif GvMULTI_on(gv); if ((cv = GvFORM(gv))) { if (ckWARN(WARN_REDEFINE)) { diff --git a/pp_sys.c b/pp_sys.c index 28407e0..0179323 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -804,11 +804,6 @@ PP(pp_tie) break; case SVt_PVGV: if (isGV_with_GP(varsv)) { -#ifdef GV_UNIQUE_CHECK - if (GvUNIQUE((const GV *)varsv)) { - Perl_croak(aTHX_ "Attempt to tie unique GV"); - } -#endif methname = "TIEHANDLE"; how = PERL_MAGIC_tiedscalar; /* For tied filehandles, we apply tiedscalar magic to the IO diff --git a/sv.c b/sv.c index 12ca453..68caa6d 100644 --- a/sv.c +++ b/sv.c @@ -3621,12 +3621,6 @@ S_glob_assign_glob(pTHX_ SV *const dstr, SV *const sstr, const int dtype) SvFAKE_on(dstr); /* can coerce to non-glob */ } -#ifdef GV_UNIQUE_CHECK - if (GvUNIQUE((const GV *)dstr)) { - Perl_croak(aTHX_ "%s", PL_no_modify); - } -#endif - if(GvGP(MUTABLE_GV(sstr))) { /* If source has method cache entry, clear it */ if(GvCVGEN(sstr)) { @@ -3680,12 +3674,6 @@ S_glob_assign_ref(pTHX_ SV *const dstr, SV *const sstr) PERL_ARGS_ASSERT_GLOB_ASSIGN_REF; -#ifdef GV_UNIQUE_CHECK - if (GvUNIQUE((const GV *)dstr)) { - Perl_croak(aTHX_ "%s", PL_no_modify); - } -#endif - if (intro) { GvINTRO_off(dstr); /* one-shot flag */ GvLINE(dstr) = CopLINE(PL_curcop); @@ -10909,9 +10897,6 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) break; case SVt_PVGV: - if (GvUNIQUE((const GV *)sstr)) { - NOOP; /* Do sharing here, and fall through */ - } case SVt_PVIO: case SVt_PVFM: case SVt_PVHV: @@ -11123,8 +11108,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) CvROOT(dstr) = OpREFCNT_inc(CvROOT(dstr)); OP_REFCNT_UNLOCK; if (CvCONST(dstr) && CvISXSUB(dstr)) { - CvXSUBANY(dstr).any_ptr = GvUNIQUE(CvGV(dstr)) ? - SvREFCNT_inc(CvXSUBANY(dstr).any_ptr) : + CvXSUBANY(dstr).any_ptr = sv_dup_inc((const SV *)CvXSUBANY(dstr).any_ptr, param); } /* don't dup if copying back - CvGV isn't refcounted, so the diff --git a/toke.c b/toke.c index ca18af1..e3e0544 100644 --- a/toke.c +++ b/toke.c @@ -4376,11 +4376,6 @@ Perl_yylex(pTHX) if (len == 6 && strnEQ(SvPVX(sv), "unique", len)) { sv_free(sv); if (PL_in_my == KEY_our) { -#ifdef USE_ITHREADS - GvUNIQUE_on(cGVOPx_gv(pl_yylval.opval)); -#else - /* skip to avoid loading attributes.pm */ -#endif deprecate(":unique"); } else