diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-01-25 09:27:56 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-05-21 07:03:51 +0100 |
commit | 6e1287864cd02fb6f429f12a995e1c08e03572b9 (patch) | |
tree | 26a68af882fe54347da6600cc410256b1d6cc625 | |
parent | 601dfd0af0604fa7ed2cabe7f33a232b9b3908c0 (diff) | |
download | perl-6e1287864cd02fb6f429f12a995e1c08e03572b9.tar.gz |
In the SV body, exchange the positions of the NV and stash/magic.
-rw-r--r-- | av.h | 5 | ||||
-rw-r--r-- | cv.h | 1 | ||||
-rw-r--r-- | hv.h | 5 | ||||
-rw-r--r-- | regexp.h | 2 | ||||
-rw-r--r-- | sv.c | 13 | ||||
-rw-r--r-- | sv.h | 25 |
6 files changed, 26 insertions, 25 deletions
@@ -9,10 +9,11 @@ */ struct xpvav { - union _xnvu xnv_u; + HV* xmg_stash; /* class package */ + union _xmgu xmg_u; SSize_t xav_fill; /* Index of last element present */ SSize_t xav_max; /* max index for which array has space */ - _XPVMG_HEAD; + union _xivu xiv_u; }; /* SV** xav_alloc; */ @@ -12,7 +12,6 @@ struct xpvcv { _XPV_HEAD; - _XPVMG_HEAD; _XPVCV_COMMON; }; @@ -83,10 +83,11 @@ struct xpvhv_aux { /* hash structure: */ /* This structure must match the beginning of struct xpvmg in sv.h. */ struct xpvhv { - union _xnvu xnv_u; + HV* xmg_stash; /* class package */ + union _xmgu xmg_u; STRLEN xhv_fill; /* how full xhv_array currently is */ STRLEN xhv_max; /* subscript of last element of xhv_array */ - _XPVMG_HEAD; + union _xivu xiv_u; }; #define xhv_keys xiv_u.xivu_iv @@ -103,7 +103,7 @@ typedef struct regexp_paren_pair { typedef struct regexp { _XPV_HEAD; - _XPVMG_HEAD; + union _xivu xiv_u; _REGEXP_COMMON; } regexp; @@ -915,8 +915,9 @@ static const struct body_details bodies_by_type[] = { }, /* 8 bytes on most ILP32 with IEEE doubles */ - { sizeof(NV), sizeof(NV), 0, SVt_NV, FALSE, HADNV, HASARENA, - FIT_ARENA(0, sizeof(NV)) }, + { sizeof(NV), sizeof(NV), + STRUCT_OFFSET(XPVNV, xnv_u), + SVt_NV, FALSE, HADNV, HASARENA, FIT_ARENA(0, sizeof(NV)) }, /* 8 bytes on most ILP32 with IEEE doubles */ { sizeof(XPV), @@ -933,11 +934,11 @@ static const struct body_details bodies_by_type[] = { FIT_ARENA(0, sizeof(XPV)) }, /* 20 */ - { sizeof(XPVNV), copy_length(XPVNV, xiv_u), 0, SVt_PVNV, FALSE, HADNV, + { sizeof(XPVNV), copy_length(XPVNV, xnv_u), 0, SVt_PVNV, FALSE, HADNV, HASARENA, FIT_ARENA(0, sizeof(XPVNV)) }, /* 28 */ - { sizeof(XPVMG), copy_length(XPVMG, xmg_stash), 0, SVt_PVMG, FALSE, HADNV, + { sizeof(XPVMG), copy_length(XPVMG, xnv_u), 0, SVt_PVMG, FALSE, HADNV, HASARENA, FIT_ARENA(0, sizeof(XPVMG)) }, /* something big */ @@ -957,13 +958,13 @@ static const struct body_details bodies_by_type[] = { HASARENA, FIT_ARENA(0, sizeof(XPVLV)) }, { sizeof(XPVAV), - copy_length(XPVAV, xmg_stash), + copy_length(XPVAV, xiv_u), 0, SVt_PVAV, TRUE, NONV, HASARENA, FIT_ARENA(0, sizeof(XPVAV)) }, { sizeof(XPVHV), - copy_length(XPVHV, xmg_stash), + copy_length(XPVHV, xiv_u), 0, SVt_PVHV, TRUE, NONV, HASARENA, FIT_ARENA(0, sizeof(XPVHV)) }, @@ -394,8 +394,9 @@ perform the upgrade if necessary. See C<svtype>. /* RV upwards. However, SVf_ROK and SVp_IOK are exclusive */ #define SVprv_WEAKREF 0x80000000 /* Weak reference */ -#define _XPV_HEAD \ - union _xnvu xnv_u; \ +#define _XPV_HEAD \ + HV* xmg_stash; /* class package */ \ + union _xmgu xmg_u; \ STRLEN xpv_cur; /* length of svu_pv as a C string */ \ STRLEN xpv_len /* allocated size */ @@ -449,23 +450,20 @@ struct xpvuv { struct xpvnv { _XPV_HEAD; union _xivu xiv_u; + union _xnvu xnv_u; }; -#define _XPVMG_HEAD \ - union _xivu xiv_u; \ - union _xmgu xmg_u; \ - HV* xmg_stash /* class package */ - /* This structure must match the beginning of struct xpvhv in hv.h. */ struct xpvmg { _XPV_HEAD; - _XPVMG_HEAD; + union _xivu xiv_u; + union _xnvu xnv_u; }; struct xpvlv { _XPV_HEAD; - _XPVMG_HEAD; - + union _xivu xiv_u; + union _xnvu xnv_u; STRLEN xlv_targoff; STRLEN xlv_targlen; SV* xlv_targ; @@ -477,7 +475,8 @@ struct xpvlv { Boyer-Moore. */ struct xpvgv { _XPV_HEAD; - _XPVMG_HEAD; + union _xivu xiv_u; + union _xnvu xnv_u; }; /* This structure must match XPVCV in cv.h */ @@ -485,6 +484,7 @@ struct xpvgv { typedef U16 cv_flags_t; #define _XPVCV_COMMON \ + union _xivu xiv_u; \ HV * xcv_stash; \ union { \ OP * xcv_start; \ @@ -505,7 +505,6 @@ typedef U16 cv_flags_t; struct xpvfm { _XPV_HEAD; - _XPVMG_HEAD; _XPVCV_COMMON; }; @@ -541,7 +540,7 @@ struct xpvfm { struct xpvio { _XPV_HEAD; - _XPVMG_HEAD; + union _xivu xiv_u; _XPVIO_TAIL; }; |