From f1f1936442c5bdb04e4ce83479e97319d753cb3b Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 30 Oct 2010 14:56:53 +0100 Subject: [PATCH] Merge B::GV::{STASH,GvFLAGS} into the common accessor. On this platform this reduces the object code size by over 1K. --- ext/B/B.xs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/B/B.xs b/ext/B/B.xs index c95afe3..e9c0f7e 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1375,6 +1375,14 @@ MODULE = B PACKAGE = B::IV #define PVLV_targ_ix sv_SVp | offsetof(struct xpvlv, xlv_targ) #define PVLV_type_ix sv_char_p | offsetof(struct xpvlv, xlv_type) +#if PERL_VERSION >= 10 +#define PVGV_stash_ix sv_SVp | offsetof(struct xpvgv, xnv_u.xgv_stash) +#define PVGV_flags_ix sv_STRLENp | offsetof(struct xpvgv, xpv_cur) +#else +#define PVGV_stash_ix sv_SVp | offsetof(struct xpvgv, xgv_stash) +#define PVGV_flags_ix sv_U8p | offsetof(struct xpvgv, xgv_flags) +#endif + # The type checking code in B has always been identical for all SV types, # irrespective of whether the action is actually defined on that SV. # We should fix this @@ -1396,6 +1404,8 @@ IVX(sv) B::PVLV::TARGLEN = PVLV_targlen_ix B::PVLV::TARG = PVLV_targ_ix B::PVLV::TYPE = PVLV_type_ix + B::GV::STASH = PVGV_stash_ix + B::GV::GvFLAGS = PVGV_flags_ix PREINIT: char *ptr; SV *ret; @@ -1726,10 +1736,6 @@ void* GvGP(gv) B::GV gv -B::HV -GvSTASH(gv) - B::GV gv - #define GP_sv_ix SVp | offsetof(struct gp, gp_sv) #define GP_io_ix SVp | offsetof(struct gp, gp_io) #define GP_cv_ix SVp | offsetof(struct gp, gp_cv) @@ -1784,12 +1790,6 @@ B::GV GvFILEGV(gv) B::GV gv -MODULE = B PACKAGE = B::GV - -U8 -GvFLAGS(gv) - B::GV gv - MODULE = B PACKAGE = B::IO PREFIX = Io long -- 1.8.3.1