CV * gp_cv; /* subroutine value */
U32 gp_cvgen; /* generational validity of cached gv_cv */
line_t gp_line; /* line first declared at (for -w) */
- char * gp_file; /* file first declared in (for -w) */
+ HEK * gp_file_hek; /* file first declared in (for -w) */
};
#define GvXPVGV(gv) ((XPVGV*)SvANY(gv))
-/* MSVC++ 6.0 (_MSC_VER == 1200) can't compile pp_hot.c with DEBUGGING enabled
- * if we include the following assert(). Must be a compiler bug because it
- * works fine with MSVC++ 7.0. Borland (5.5.1) has the same problem. */
-#if defined(DEBUGGING) && \
- ((!defined(_MSC_VER) || _MSC_VER > 1200) && !defined(__BORLANDC__))
-# define GvGP(gv) (*(assert(SvTYPE(gv) == SVt_PVGV || \
- SvTYPE(gv) == SVt_PVLV), \
- assert(isGV_with_GP(gv)), \
- &((gv)->sv_u.svu_gp)))
-#else
-# define GvGP(gv) ((gv)->sv_u.svu_gp)
-#endif
-
-#define GvNAME(gv) (GvXPVGV(gv)->xgv_name)
-#define GvNAMELEN(gv) (GvXPVGV(gv)->xgv_namelen)
-#define GvFLAGS(gv) (GvXPVGV(gv)->xgv_flags)
-#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
+#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__INTEL_COMPILER)
+# define GvGP(gv) \
+ (*({GV *const shplep = (GV *) (gv); \
+ assert(SvTYPE(shplep) == SVt_PVGV || SvTYPE(shplep) == SVt_PVLV); \
+ assert(isGV_with_GP(shplep)); \
+ &((shplep)->sv_u.svu_gp);}))
+# define GvFLAGS(gv) \
+ (*({GV *const yaah = (GV *) (gv); \
+ assert(SvTYPE(yaah) == SVt_PVGV || SvTYPE(yaah) == SVt_PVLV); \
+ assert(isGV_with_GP(yaah)); \
+ &(GvXPVGV(yaah)->xpv_cur);}))
# define GvSTASH(gv) \
- (*({ GV *_gv = (GV *) gv; \
+ (*({ GV * const _gv = (GV *) (gv); \
+ assert(isGV_with_GP(_gv)); \
assert(SvTYPE(_gv) == SVt_PVGV || SvTYPE(_gv) >= SVt_PVLV); \
- &(GvXPVGV(_gv)->xgv_stash); \
+ &(GvXPVGV(_gv)->xnv_u.xgv_stash); \
}))
+# define GvNAME_HEK(gv) \
+ (*({ GV * const zzzz = (GV *) (gv); \
+ assert(isGV_with_GP(zzzz)); \
+ assert(SvTYPE(zzzz) == SVt_PVGV || SvTYPE(zzzz) >= SVt_PVLV); \
+ assert(!SvVALID(zzzz)); \
+ &(GvXPVGV(zzzz)->xiv_u.xivu_namehek); \
+ }))
+# define GvNAME_get(gv) ({ assert(GvNAME_HEK(gv)); HEK_KEY(GvNAME_HEK(gv)); })
+# define GvNAMELEN_get(gv) ({ assert(GvNAME_HEK(gv)); HEK_LEN(GvNAME_HEK(gv)); })
#else
-#define GvSTASH(gv) (GvXPVGV(gv)->xgv_stash)
+# define GvGP(gv) ((gv)->sv_u.svu_gp)
+# define GvFLAGS(gv) (GvXPVGV(gv)->xpv_cur)
+# define GvSTASH(gv) (GvXPVGV(gv)->xnv_u.xgv_stash)
+# define GvNAME_HEK(gv) (GvXPVGV(gv)->xiv_u.xivu_namehek)
+# define GvNAME_get(gv) HEK_KEY(GvNAME_HEK(gv))
+# define GvNAMELEN_get(gv) HEK_LEN(GvNAME_HEK(gv))
#endif
+
+#define GvNAME(gv) GvNAME_get(gv)
+#define GvNAMELEN(gv) GvNAMELEN_get(gv)
+
+#define GvASSIGN_GENERATION(gv) (0 + ((XPV*) SvANY(gv))->xpv_len)
+#define GvASSIGN_GENERATION_set(gv,val) \
+ STMT_START { assert(SvTYPE(gv) == SVt_PVGV); \
+ (((XPV*) SvANY(gv))->xpv_len = (val)); } STMT_END
+
/*
=head1 GV Functions
#define GvCVu(gv) (GvGP(gv)->gp_cvgen ? NULL : GvGP(gv)->gp_cv)
#define GvLINE(gv) (GvGP(gv)->gp_line)
-#define GvFILE(gv) (GvGP(gv)->gp_file)
+#define GvFILE_HEK(gv) (GvGP(gv)->gp_file_hek)
+#define GvFILE(gv) HEK_KEY(GvFILE_HEK(gv))
#define GvFILEGV(gv) (gv_fetchfile(GvFILE(gv)))
#define GvEGV(gv) (GvGP(gv)->gp_egv)
#define GvIN_PAD_off(gv) (GvFLAGS(gv) &= ~GVf_IN_PAD)
#define GvUNIQUE(gv) 0
-#define GvUNIQUE_on(gv)
-#define GvUNIQUE_off(gv)
+#define GvUNIQUE_on(gv) NOOP
+#define GvUNIQUE_off(gv) NOOP
#ifdef USE_ITHREADS
#define GV_UNIQUE_CHECK
/*
* symbol creation flags, for use in gv_fetchpv() and get_*v()
*/
-#define GV_ADD 0x01 /* add, if symbol not already there */
+#define GV_ADD 0x01 /* add, if symbol not already there
+ For gv_name_set, adding a HEK for the first
+ time, so don't try to free what's there. */
#define GV_ADDMULTI 0x02 /* add, pretending it has been added already */
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */
#define gv_fullname3(sv,gv,prefix) gv_fullname4(sv,gv,prefix,TRUE)
#define gv_efullname3(sv,gv,prefix) gv_efullname4(sv,gv,prefix,TRUE)
#define gv_fetchmethod(stash, name) gv_fetchmethod_autoload(stash, name, TRUE)
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */