summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-11 20:39:31 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-11 20:39:31 -0800
commit4df35a07ff9fe98fb378b84929dddace96bcb9fb (patch)
treeec135193be5043f6d128fa191677320e8f8f7389
parentb89cdb229b520dceadf180df9462c8a0a1edf975 (diff)
downloadperl-4df35a07ff9fe98fb378b84929dddace96bcb9fb.tar.gz
mro_isa_changed_in3 is no longer necessary
as of 80ebaca. It was nice while it lasted. This reverts 6f86b615fa.
-rw-r--r--embed.fnc3
-rw-r--r--embed.h2
-rw-r--r--hv.h1
-rw-r--r--mathoms.c7
-rw-r--r--mro.c55
-rw-r--r--proto.h7
6 files changed, 24 insertions, 51 deletions
diff --git a/embed.fnc b/embed.fnc
index 8156a93246..7188db971d 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2369,8 +2369,7 @@ s |void |mro_gather_and_rename|NN HV * const stashes \
|NN const char *name|I32 namlen
#endif
: Used in hv.c, mg.c, pp.c, sv.c
-md |void |mro_isa_changed_in|NN HV* stash
-pd |void |mro_isa_changed_in3|NULLOK HV* stash|NULLOK const char *stashname|STRLEN stashname_len
+pd |void |mro_isa_changed_in|NN HV* stash
Apd |void |mro_method_changed_in |NN HV* stash
pdx |void |mro_package_moved |NULLOK HV * const stash|NULLOK HV * const oldstash|NULLOK const GV *gv|NULLOK const char *newname|I32 newname_len
: Only used in perl.c
diff --git a/embed.h b/embed.h
index 64c352c4a6..0d5553ce89 100644
--- a/embed.h
+++ b/embed.h
@@ -1057,7 +1057,7 @@
#define magic_wipepack(a,b) Perl_magic_wipepack(aTHX_ a,b)
#define mg_localize(a,b,c) Perl_mg_localize(aTHX_ a,b,c)
#define mode_from_discipline(a,b) Perl_mode_from_discipline(aTHX_ a,b)
-#define mro_isa_changed_in3(a,b,c) Perl_mro_isa_changed_in3(aTHX_ a,b,c)
+#define mro_isa_changed_in(a) Perl_mro_isa_changed_in(aTHX_ a)
#define mro_package_moved(a,b,c,d,e) Perl_mro_package_moved(aTHX_ a,b,c,d,e)
#define munge_qwlist_to_paren_list(a) Perl_munge_qwlist_to_paren_list(aTHX_ a)
#define my_attrs(a,b) Perl_my_attrs(aTHX_ a,b)
diff --git a/hv.h b/hv.h
index 33ecef5d0f..6a4132434f 100644
--- a/hv.h
+++ b/hv.h
@@ -67,7 +67,6 @@ struct mro_meta {
(((smeta)->mro_which && (which) == (smeta)->mro_which) \
? (smeta)->mro_linear_current \
: Perl_mro_get_private_data(aTHX_ (smeta), (which)))
-#define mro_isa_changed_in(stash) mro_isa_changed_in3(stash, NULL, 0)
/* Subject to change.
Don't access this directly.
diff --git a/mathoms.c b/mathoms.c
index 2a5650439c..78516b3d4b 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -83,7 +83,6 @@ PERL_CALLCONV I32 Perl_my_lstat(pTHX);
PERL_CALLCONV I32 Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2);
PERL_CALLCONV char * Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp);
PERL_CALLCONV bool Perl_sv_2bool(pTHX_ register SV *const sv);
-PERL_CALLCONV void Perl_mro_isa_changed_in(pTHX_ HV* stash);
/* ref() is now a macro using Perl_doref;
* this version provided for binary compatibility only.
@@ -1555,12 +1554,6 @@ Perl_sv_2bool(pTHX_ register SV *const sv)
return sv_2bool_flags(sv, SV_GMAGIC);
}
-void
-Perl_mro_isa_changed_in(pTHX_ HV* stash)
-{
- mro_isa_changed_in3(stash, NULL, 0);
-}
-
#endif /* NO_MATHOMS */
/*
diff --git a/mro.c b/mro.c
index 7c40688836..4435c2b1a9 100644
--- a/mro.c
+++ b/mro.c
@@ -441,22 +441,10 @@ Takes the necessary steps (cache invalidations, mostly)
when the @ISA of the given package has changed. Invoked
by the C<setisa> magic, should not need to invoke directly.
-=for apidoc mro_isa_changed_in3
-
-Takes the necessary steps (cache invalidations, mostly)
-when the @ISA of the given package has changed. Invoked
-by the C<setisa> magic, should not need to invoke directly.
-
-The stash can be passed as the first argument, or its name and length as
-the second and third (or both). If just the name is passed and the stash
-does not exist, then only the subclasses' method and isa caches will be
-invalidated.
-
=cut
*/
void
-Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname,
- STRLEN stashname_len)
+Perl_mro_isa_changed_in(pTHX_ HV* stash)
{
dVAR;
HV* isarev;
@@ -465,42 +453,39 @@ Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname,
SV** svp;
I32 items;
bool is_universal;
- struct mro_meta * meta = NULL;
+ struct mro_meta * meta;
HV *isa = NULL;
- if(!stashname && stash) {
- stashname = HvENAME_get(stash);
- stashname_len = HvENAMELEN_get(stash);
- }
- else if(!stash)
- stash = gv_stashpvn(stashname, stashname_len, 0 /* don't add */);
+ const char * const stashname = HvENAME_get(stash);
+ const STRLEN stashname_len = HvENAMELEN_get(stash);
+
+ PERL_ARGS_ASSERT_MRO_ISA_CHANGED_IN;
if(!stashname)
Perl_croak(aTHX_ "Can't call mro_isa_changed_in() on anonymous symbol table");
- if(stash) {
- /* wipe out the cached linearizations for this stash */
- meta = HvMROMETA(stash);
- if (meta->mro_linear_all) {
+
+ /* wipe out the cached linearizations for this stash */
+ meta = HvMROMETA(stash);
+ if (meta->mro_linear_all) {
SvREFCNT_dec(MUTABLE_SV(meta->mro_linear_all));
meta->mro_linear_all = NULL;
/* This is just acting as a shortcut pointer. */
meta->mro_linear_current = NULL;
- } else if (meta->mro_linear_current) {
+ } else if (meta->mro_linear_current) {
/* Only the current MRO is stored, so this owns the data. */
SvREFCNT_dec(meta->mro_linear_current);
meta->mro_linear_current = NULL;
- }
- if (meta->isa) {
+ }
+ if (meta->isa) {
/* Steal it for our own purposes. */
isa = (HV *)sv_2mortal((SV *)meta->isa);
meta->isa = NULL;
- }
-
- /* Inc the package generation, since our @ISA changed */
- meta->pkg_gen++;
}
+ /* Inc the package generation, since our @ISA changed */
+ meta->pkg_gen++;
+
/* Wipe the global method cache if this package
is UNIVERSAL or one of its parents */
@@ -513,12 +498,12 @@ Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname,
is_universal = TRUE;
}
else { /* Wipe the local method cache otherwise */
- if(meta) meta->cache_gen++;
+ meta->cache_gen++;
is_universal = FALSE;
}
/* wipe next::method cache too */
- if(meta && meta->mro_nextmethod) hv_clear(meta->mro_nextmethod);
+ if(meta->mro_nextmethod) hv_clear(meta->mro_nextmethod);
/* Iterate the isarev (classes that are our children),
wiping out their linearization, method and isa caches
@@ -638,9 +623,6 @@ Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname,
our isarev to their isarev.
*/
- /* This only applies if the stash exists. */
- if(!stash) goto clean_up_isarev;
-
/* We're starting at the 2nd element, skipping ourselves here */
linear_mro = mro_get_linear_isa(stash);
svp = AvARRAY(linear_mro) + 1;
@@ -668,7 +650,6 @@ Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname,
(void)hv_store(mroisarev, stashname, stashname_len, &PL_sv_yes, 0);
}
- clean_up_isarev:
/* Delete our name from our former parents’ isarevs. */
if(isa && HvARRAY(isa))
mro_clean_isarev(isa, stashname, stashname_len, meta->isa);
diff --git a/proto.h b/proto.h
index 4002d67414..3bae4fe52b 100644
--- a/proto.h
+++ b/proto.h
@@ -2257,10 +2257,11 @@ PERL_CALLCONV SV* Perl_mro_get_private_data(pTHX_ struct mro_meta *const smeta,
#define PERL_ARGS_ASSERT_MRO_GET_PRIVATE_DATA \
assert(smeta); assert(which)
-/* PERL_CALLCONV void mro_isa_changed_in(pTHX_ HV* stash)
- __attribute__nonnull__(pTHX_1); */
+PERL_CALLCONV void Perl_mro_isa_changed_in(pTHX_ HV* stash)
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_MRO_ISA_CHANGED_IN \
+ assert(stash)
-PERL_CALLCONV void Perl_mro_isa_changed_in3(pTHX_ HV* stash, const char *stashname, STRLEN stashname_len);
PERL_CALLCONV struct mro_meta* Perl_mro_meta_init(pTHX_ HV* stash)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_MRO_META_INIT \