diff options
author | David Mitchell <davem@iabyn.com> | 2016-11-12 13:19:58 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-11-12 16:15:09 +0000 |
commit | b4204fb6f01f49bdf8ebb6d68e0f713a505f069a (patch) | |
tree | c54d4db80ac36e6f9d649fc74784848dbac8399d /sv.h | |
parent | e08d24ff56cda24d8146e29d00376eb23eedbd7e (diff) | |
download | perl-b4204fb6f01f49bdf8ebb6d68e0f713a505f069a.tar.gz |
eliminate SVpbm_TAIL/SvTAIL_on()/SvTAIL_off()
(but keep SvTAIL())
This flag is only set on SVs that have Boyer-Moore magic attached.
Such SVs already re-purpose the unused IVX slot of that SV to store
BmUSEFUL. This commit repurposes the unused NVX slot to store this
boolean value instead.
Now that flag bit (0x80000000) is only used with AVs, HVs, RVs and
scalar SVs with IOK.
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -463,8 +463,6 @@ perform the upgrade if necessary. See C<L</svtype>>. #define SVpav_REIFY 0x80000000 /* can become real */ /* PVHV */ #define SVphv_HASKFLAGS 0x80000000 /* keys have flag byte after hash */ -/* PVGV when SVpbm_VALID is true */ -#define SVpbm_TAIL 0x80000000 /* string has a fake "\n" appended */ /* RV upwards. However, SVf_ROK and SVp_IOK are exclusive */ #define SVprv_WEAKREF 0x80000000 /* Weak reference */ /* pad name vars only */ @@ -484,6 +482,7 @@ union _xnvu { NV xnv_nv; /* numeric value, if any */ HV * xgv_stash; line_t xnv_lines; /* used internally by S_scan_subst() */ + bool xnv_bm_tail; /* an SvVALID (BM) SV has an implicit "\n" */ }; union _xivu { @@ -491,6 +490,7 @@ union _xivu { UV xivu_uv; HEK * xivu_namehek; /* xpvlv, xpvgv: GvNAME */ bool xivu_eval_seen; /* used internally by S_scan_subst() */ + }; union _xmgu { @@ -1139,21 +1139,17 @@ object type. Exposed to perl code via Internals::SvREADONLY(). # define SvTAIL(sv) ({ const SV *const _svtail = (const SV *)(sv); \ assert(SvTYPE(_svtail) != SVt_PVAV); \ assert(SvTYPE(_svtail) != SVt_PVHV); \ - assert(!SvSCREAM(_svtail)); \ - assert((SvFLAGS(sv) & SVpbm_VALID)); \ - (SvFLAGS(sv) & (SVpbm_TAIL|SVpbm_VALID)) \ - == (SVpbm_TAIL|SVpbm_VALID); \ + assert((SvFLAGS(_svtail) & SVpbm_VALID)); \ + assert(!(SvFLAGS(_svtail) & (SVf_NOK|SVp_NOK))); \ + ((XPVNV*)SvANY(_svtail))->xnv_u.xnv_bm_tail; \ }) #else # define SvVALID(sv) ((SvFLAGS(sv) & SVpbm_VALID) && !SvSCREAM(sv)) # define SvVALID_on(sv) (SvFLAGS(sv) |= SVpbm_VALID) # define SvVALID_off(sv) (SvFLAGS(sv) &= ~SVpbm_VALID) -# define SvTAIL(sv) ((SvFLAGS(sv) & (SVpbm_TAIL|SVpbm_VALID)) \ - == (SVpbm_TAIL|SVpbm_VALID)) +# define SvTAIL(_svtail) (((XPVNV*)SvANY(_svtail))->xnv_u.xnv_bm_tail) #endif -#define SvTAIL_on(sv) (SvFLAGS(sv) |= SVpbm_TAIL) -#define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL) #define SvRVx(sv) SvRV(sv) |