@@ -228,80 +228,6 @@ static void* dasm_labels[zend_lb_MAX];
228
228
| .endif
229
229
|.endmacro
230
230
231
- |.macro SAVE_OPLINE
232
- || if (GCC_GLOBAL_REGS) {
233
- | mov aword EX->opline, IP
234
- || }
235
- |.endmacro
236
-
237
- |.macro LOAD_OPLINE
238
- || if (GCC_GLOBAL_REGS) {
239
- | mov IP, aword EX->opline
240
- || }
241
- |.endmacro
242
-
243
- |.macro LOAD_IP_ADDR, addr
244
- || if (GCC_GLOBAL_REGS) {
245
- | LOAD_ADDR IP, addr
246
- || } else {
247
- | LOAD_ADDR RX, addr
248
- | mov aword EX->opline, RX
249
- || }
250
- |.endmacro
251
-
252
- |.macro LOAD_IP_ADDR_ZTS, struct, field
253
- | .if ZTS
254
- || if (GCC_GLOBAL_REGS) {
255
- | LOAD_TSRM_CACHE IP
256
- | mov IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
257
- || } else {
258
- | LOAD_TSRM_CACHE RX
259
- | lea RX, aword [RX + (struct.._offset + offsetof(zend_..struct, field))]
260
- | mov aword EX->opline, RX
261
- || }
262
- | .else
263
- | LOAD_IP_ADDR &struct.field
264
- | .endif
265
- |.endmacro
266
-
267
- |.macro GET_IP, reg
268
- || if (GCC_GLOBAL_REGS) {
269
- | mov reg, IP
270
- || } else {
271
- | mov reg, aword EX->opline
272
- || }
273
- |.endmacro
274
-
275
- |.macro ADD_IP, val
276
- || if (GCC_GLOBAL_REGS) {
277
- | add IP, val
278
- || } else {
279
- | add aword EX->opline, val
280
- || }
281
- |.endmacro
282
-
283
- |.macro JMP_IP
284
- || if (GCC_GLOBAL_REGS) {
285
- | jmp aword [IP]
286
- || } else {
287
- | mov r0, aword EX:FCARG1a->opline
288
- | jmp aword [r0]
289
- || }
290
- |.endmacro
291
-
292
- /* In 64-bit build we compare only low 32-bits.
293
- * x86_64 cmp instruction doesn't support immediate 64-bit operand, and full
294
- * comparison would require an additional load of 64-bit address into register.
295
- * This is not a problem at all, while JIT buffer size is less than 4GB.
296
- */
297
- |.macro CMP_IP, addr
298
- || if (GCC_GLOBAL_REGS) {
299
- | cmp IPl, addr
300
- || } else {
301
- | cmp dword EX->opline, addr
302
- || }
303
- |.endmacro
304
-
305
231
|.macro ADDR_OP1, addr_ins, addr, tmp_reg
306
232
| .if X64
307
233
|| if (IS_32BIT(addr)) {
@@ -455,6 +381,80 @@ static void* dasm_labels[zend_lb_MAX];
455
381
| .endif
456
382
|.endmacro
457
383
384
+ |.macro SAVE_OPLINE
385
+ || if (GCC_GLOBAL_REGS) {
386
+ | mov aword EX->opline, IP
387
+ || }
388
+ |.endmacro
389
+
390
+ |.macro LOAD_OPLINE
391
+ || if (GCC_GLOBAL_REGS) {
392
+ | mov IP, aword EX->opline
393
+ || }
394
+ |.endmacro
395
+
396
+ |.macro LOAD_IP_ADDR, addr
397
+ || if (GCC_GLOBAL_REGS) {
398
+ | LOAD_ADDR IP, addr
399
+ || } else {
400
+ | LOAD_ADDR RX, addr
401
+ | mov aword EX->opline, RX
402
+ || }
403
+ |.endmacro
404
+
405
+ |.macro LOAD_IP_ADDR_ZTS, struct, field
406
+ | .if ZTS
407
+ || if (GCC_GLOBAL_REGS) {
408
+ | LOAD_TSRM_CACHE IP
409
+ | mov IP, aword [IP + (struct.._offset + offsetof(zend_..struct, field))]
410
+ || } else {
411
+ | LOAD_TSRM_CACHE RX
412
+ | lea RX, aword [RX + (struct.._offset + offsetof(zend_..struct, field))]
413
+ | mov aword EX->opline, RX
414
+ || }
415
+ | .else
416
+ | LOAD_IP_ADDR &struct.field
417
+ | .endif
418
+ |.endmacro
419
+
420
+ |.macro GET_IP, reg
421
+ || if (GCC_GLOBAL_REGS) {
422
+ | mov reg, IP
423
+ || } else {
424
+ | mov reg, aword EX->opline
425
+ || }
426
+ |.endmacro
427
+
428
+ |.macro ADD_IP, val
429
+ || if (GCC_GLOBAL_REGS) {
430
+ | add IP, val
431
+ || } else {
432
+ | add aword EX->opline, val
433
+ || }
434
+ |.endmacro
435
+
436
+ |.macro JMP_IP
437
+ || if (GCC_GLOBAL_REGS) {
438
+ | jmp aword [IP]
439
+ || } else {
440
+ | mov r0, aword EX:FCARG1a->opline
441
+ | jmp aword [r0]
442
+ || }
443
+ |.endmacro
444
+
445
+ /* In 64-bit build we compare only low 32-bits.
446
+ * x86_64 cmp instruction doesn't support immediate 64-bit operand, and full
447
+ * comparison would require an additional load of 64-bit address into register.
448
+ * This is not a problem at all, while JIT buffer size is less than 4GB.
449
+ */
450
+ |.macro CMP_IP, addr
451
+ || if (GCC_GLOBAL_REGS) {
452
+ | cmp IPl, addr
453
+ || } else {
454
+ | cmp dword EX->opline, addr
455
+ || }
456
+ |.endmacro
457
+
458
458
|.macro LOAD_ZVAL_ADDR, reg, addr
459
459
|| if (Z_MODE(addr) == IS_CONST_ZVAL) {
460
460
| LOAD_ADDR reg, Z_ZV(addr)
0 commit comments