diff options
author | Brandon Black <blblack@gmail.com> | 2007-04-29 12:27:03 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-04-30 09:22:58 +0000 |
commit | dd69841bebe1fc7f7a6b248576221520a0418d52 (patch) | |
tree | 03f70519210b8c576d1dde888623afef3e9882ba /gv.c | |
parent | 49d7dfbcef7527d25e8c34643f831ef2416923a3 (diff) | |
download | perl-dd69841bebe1fc7f7a6b248576221520a0418d52.tar.gz |
Re: mro status, etc
From: "Brandon Black" <blblack@gmail.com>
Message-ID: <84621a60704291527y1b39be37l221ef66e4c828f66@mail.gmail.com>
p4raw-id: //depot/perl@31107
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 31 |
1 files changed, 4 insertions, 27 deletions
@@ -360,7 +360,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) DEBUG_o( Perl_deb(aTHX_ "Looking for method %s in package %s\n",name,hvname) ); - topgen_cmp = HvMROMETA(stash)->sub_generation + PL_sub_generation; + topgen_cmp = HvMROMETA(stash)->cache_gen + PL_sub_generation; /* check locally for a real method or a cache entry */ gvp = (GV**)hv_fetch(stash, name, len, create); @@ -405,17 +405,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) assert(linear_sv); cstash = gv_stashsv(linear_sv, 0); - /* mg.c:Perl_magic_setisa sets the fake flag on packages it had - to create that the user did not. The "package" statement - clears it. We also check if there's anything in the symbol - table at all, which would indicate a previously "fake" package - where someone adding things via $Foo::Bar = 1 without ever - using a "package" statement. - This was all neccesary because magic_setisa needs a place to - keep isarev information on packages that aren't yet defined, - yet we still need to issue this warning when appropriate. - */ - if (!cstash || (HvMROMETA(cstash)->fake && !HvFILL(cstash))) { + if (!cstash) { if (ckWARN(WARN_SYNTAX)) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Can't locate package %"SVf" for @%s::ISA", SVfARG(linear_sv), hvname); @@ -1445,15 +1435,6 @@ Perl_gp_ref(pTHX_ GP *gp) gp->gp_cv = NULL; gp->gp_cvgen = 0; } - /* XXX if anyone finds a method cache regression with - the "mro" stuff, turning this else block back on - is probably the first place to look --blblack - */ - /* - else { - PL_sub_generation++; - } - */ } return gp; } @@ -1473,10 +1454,6 @@ Perl_gp_free(pTHX_ GV *gv) pTHX__FORMAT pTHX__VALUE); return; } - if (gp->gp_cv) { - /* Deleting the name of a subroutine invalidates method cache */ - PL_sub_generation++; - } if (--gp->gp_refcnt > 0) { if (gp->gp_egv == gv) gp->gp_egv = 0; @@ -1534,7 +1511,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) AMT amt; U32 newgen; - newgen = PL_sub_generation + HvMROMETA(stash)->sub_generation; + newgen = PL_sub_generation + HvMROMETA(stash)->cache_gen; if (mg) { const AMT * const amtp = (AMT*)mg->mg_ptr; if (amtp->was_ok_am == PL_amagic_generation @@ -1665,7 +1642,7 @@ Perl_gv_handler(pTHX_ HV *stash, I32 id) if (!stash || !HvNAME_get(stash)) return NULL; - newgen = PL_sub_generation + HvMROMETA(stash)->sub_generation; + newgen = PL_sub_generation + HvMROMETA(stash)->cache_gen; mg = mg_find((SV*)stash, PERL_MAGIC_overload_table); if (!mg) { |