|
66 | 66 | #define SWIFT_ABI_DEFAULT_BRIDGEOBJECT_TAG_32 0U
|
67 | 67 | #define SWIFT_ABI_DEFAULT_BRIDGEOBJECT_TAG_64 0x8000000000000000ULL
|
68 | 68 |
|
| 69 | +// Only the bottom 56 bits are used, and heap objects are eight-byte-aligned. |
| 70 | +#define SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK 0xFF00000000000007ULL |
| 71 | + |
69 | 72 | /*********************************** i386 *************************************/
|
70 | 73 |
|
71 | 74 | // Heap objects are pointer-aligned, so the low two bits are unused.
|
|
104 | 107 | #define SWIFT_ABI_DARWIN_X86_64_LEAST_VALID_POINTER 0x100000000ULL
|
105 | 108 |
|
106 | 109 | // Only the bottom 56 bits are used, and heap objects are eight-byte-aligned.
|
107 |
| -#define SWIFT_ABI_X86_64_SWIFT_SPARE_BITS_MASK 0xFF00000000000007ULL |
| 110 | +// This is conservative: in practice architectual limitations and other |
| 111 | +// compatiblity concerns likely constrain the address space to 52 bits. |
| 112 | +#define SWIFT_ABI_X86_64_SWIFT_SPARE_BITS_MASK \ |
| 113 | + SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK |
108 | 114 |
|
109 | 115 | // Objective-C reserves the low bit for tagged pointers on macOS, but
|
110 | 116 | // reserves the high bit on simulators.
|
|
138 | 144 |
|
139 | 145 | // TBI guarantees the top byte of pointers is unused.
|
140 | 146 | // Heap objects are eight-byte aligned.
|
141 |
| -#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xFF00000000000007ULL |
| 147 | +#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK \ |
| 148 | + SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK |
142 | 149 |
|
143 | 150 | // Objective-C reserves just the high bit for tagged pointers.
|
144 | 151 | #define SWIFT_ABI_ARM64_OBJC_RESERVED_BITS_MASK 0x8000000000000000ULL
|
|
159 | 166 | /*********************************** powerpc64 ********************************/
|
160 | 167 |
|
161 | 168 | // Heap objects are pointer-aligned, so the low three bits are unused.
|
162 |
| -#define SWIFT_ABI_POWERPC64_SWIFT_SPARE_BITS_MASK 0x0000000000000007ULL |
| 169 | +#define SWIFT_ABI_POWERPC64_SWIFT_SPARE_BITS_MASK \ |
| 170 | + SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK |
163 | 171 |
|
164 | 172 | /*********************************** s390x ************************************/
|
165 | 173 |
|
166 | 174 | // Top byte of pointers is unused, and heap objects are eight-byte aligned.
|
167 | 175 | // On s390x it is theoretically possible to have high bit set but in practice
|
168 | 176 | // it is unlikely.
|
169 |
| -#define SWIFT_ABI_S390X_SWIFT_SPARE_BITS_MASK 0xFF00000000000007ULL |
| 177 | +#define SWIFT_ABI_S390X_SWIFT_SPARE_BITS_MASK SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK |
170 | 178 |
|
171 | 179 | // Objective-C reserves just the high bit for tagged pointers.
|
172 | 180 | #define SWIFT_ABI_S390X_OBJC_RESERVED_BITS_MASK 0x8000000000000000ULL
|
|
0 commit comments