summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorBrandon Black <blblack@gmail.com>2007-04-17 08:14:36 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-19 14:48:20 +0000
commite1a479c5e0c08fb10925261f03573261c69ca0dc (patch)
tree09088fd1ef489ff5660300a532f799144ff7ae6a /hv.h
parent0a311364e00e9bf5b4fcb140ade49b02e46833dd (diff)
downloadperl-e1a479c5e0c08fb10925261f03573261c69ca0dc.tar.gz
Re: new C3 MRO patch
From: "Brandon Black" <blblack@gmail.com> Message-ID: <84621a60704171114k29b0460el5b08ce5185d55ed5@mail.gmail.com> p4raw-id: //depot/perl@30980
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 0f60be36d8..7fb9fc4099 100644
--- a/hv.h
+++ b/hv.h
@@ -38,12 +38,38 @@ struct shared_he {
/* Subject to change.
Don't access this directly.
+ Use the funcs in mro.c
*/
+
+typedef enum {
+ MRO_DFS, /* 0 */
+ MRO_C3 /* 1 */
+} mro_alg;
+
+struct mro_meta {
+ AV *mro_linear_dfs; /* cached dfs @ISA linearization */
+ AV *mro_linear_c3; /* cached c3 @ISA linearization */
+ HV *mro_isarev; /* reverse @ISA dependencies (who depends on us?) */
+ HV *mro_nextmethod; /* next::method caching */
+ mro_alg mro_which; /* which mro alg is in use? */
+ U32 sub_generation; /* Like PL_sub_generation, but stash-local */
+ I32 is_universal; /* We are UNIVERSAL or a potentially indirect
+ member of @UNIVERSAL::ISA */
+ I32 fake; /* setisa made this fake package,
+ gv_fetchmeth pays attention to this,
+ and "package" sets it back to zero */
+};
+
+/* Subject to change.
+ Don't access this directly.
+*/
+
struct xpvhv_aux {
HEK *xhv_name; /* name, if a symbol table */
AV *xhv_backreferences; /* back references for weak references */
HE *xhv_eiter; /* current entry of iterator */
I32 xhv_riter; /* current root of iterator */
+ struct mro_meta *xhv_mro_meta;
};
/* hash structure: */
@@ -240,6 +266,7 @@ C<SV*>.
#define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1)
#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : 0)
#define HvNAME(hv) HvNAME_get(hv)
+#define HvMROMETA(hv) (HvAUX(hv)->xhv_mro_meta ? HvAUX(hv)->xhv_mro_meta : mro_meta_init(hv))
/* FIXME - all of these should use a UTF8 aware API, which should also involve
getting the length. */
/* This macro may go away without notice. */