Commit 4a761a5
committed
Zend: store the zend_type kind discriminator in a dedicated field
zend_type packed the "what does ptr point at" discriminator
(_ZEND_TYPE_NAME_BIT / _ZEND_TYPE_LITERAL_NAME_BIT / _ZEND_TYPE_LIST_BIT)
into the high bits of type_mask, sharing the word with the MAY_BE_* mask
and the arg-info extra flags. Only two bits were left free, which is not
enough room for additional type kinds.
Move the discriminator into a new `uint32_t kind` field. On 64-bit this
occupies the existing 4 bytes of struct padding, so sizeof(zend_type)
stays 16 (resolves the long-standing TODO); on 32-bit zend_type grows
from 8 to 12 bytes. This frees type_mask bits 22-24 and gives the kind
field room for future kinds.
Pure refactor, no behaviour change. The bit constants keep their values
and are simply read from / written to `kind` now. ZEND_TYPE_IS_SET()
additionally checks `kind`, and the JIT's inlined typed-property
IS_SET check ORs the kind field in.
Signed-off-by: azjezz <azjezz@protonmail.com>1 parent 8c63ec4 commit 4a761a5
4 files changed
Lines changed: 33 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2937 | 2937 | | |
2938 | 2938 | | |
2939 | 2939 | | |
2940 | | - | |
| 2940 | + | |
2941 | 2941 | | |
2942 | 2942 | | |
2943 | 2943 | | |
| |||
2951 | 2951 | | |
2952 | 2952 | | |
2953 | 2953 | | |
2954 | | - | |
| 2954 | + | |
2955 | 2955 | | |
2956 | 2956 | | |
2957 | 2957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7621 | 7621 | | |
7622 | 7622 | | |
7623 | 7623 | | |
7624 | | - | |
7625 | | - | |
| 7624 | + | |
7626 | 7625 | | |
7627 | 7626 | | |
7628 | 7627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
298 | | - | |
| 297 | + | |
299 | 298 | | |
300 | 299 | | |
301 | | - | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | | - | |
| 303 | + | |
305 | 304 | | |
306 | 305 | | |
307 | | - | |
| 306 | + | |
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
313 | | - | |
| 312 | + | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
319 | | - | |
| 318 | + | |
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16115 | 16115 | | |
16116 | 16116 | | |
16117 | 16117 | | |
16118 | | - | |
16119 | | - | |
16120 | | - | |
| 16118 | + | |
| 16119 | + | |
| 16120 | + | |
| 16121 | + | |
| 16122 | + | |
16121 | 16123 | | |
16122 | 16124 | | |
16123 | 16125 | | |
| |||
16144 | 16146 | | |
16145 | 16147 | | |
16146 | 16148 | | |
16147 | | - | |
16148 | | - | |
16149 | | - | |
| 16149 | + | |
| 16150 | + | |
| 16151 | + | |
| 16152 | + | |
| 16153 | + | |
16150 | 16154 | | |
16151 | 16155 | | |
16152 | 16156 | | |
| |||
0 commit comments