@@ -2313,24 +2313,24 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst)
2313
2313
| stp d20, d21, [sp, #-16]!
2314
2314
| stp d18, d19, [sp, #-16]!
2315
2315
| stp d16, d17, [sp, #-16]!
2316
- | stp d14, d15, [sp, #-16]!
2317
- | stp d12, d13, [sp, #-16]!
2318
- | stp d10, d11, [sp, #-16]!
2319
- | stp d8, d9, [sp, #-16]!
2320
- | stp d6, d7, [sp, #-16]!
2316
+ | // stp d14, d15, [sp, #-16]! // we don't use preserved registers yet
2317
+ | // stp d12, d13, [sp, #-16]!
2318
+ | // stp d10, d11, [sp, #-16]!
2319
+ | // stp d8, d9, [sp, #-16]!
2320
+ | stp d6, d7, [sp, #( -16*5) ]!
2321
2321
| stp d4, d5, [sp, #-16]!
2322
2322
| stp d2, d3, [sp, #-16]!
2323
2323
| stp d0, d1, [sp, #-16]!
2324
2324
|
2325
- | str x30, [sp, #-16]! // x31 can be omitted
2326
- | stp x28, x29, [sp, #-16]!
2327
- | stp x26, x27, [sp, #-16]!
2328
- | stp x24, x25, [sp, #-16]!
2329
- | stp x22, x23, [sp, #-16]!
2330
- | stp x20, x21, [sp, #-16]!
2331
- | stp x18, x19, [sp, #-16]!
2332
- | stp x16, x17, [sp, #-16]!
2333
- | stp x14, x15, [sp, #-16 ]!
2325
+ | // str x30, [sp, #-16]! // we don't use callee-saved registers yet ( x31 can be omitted)
2326
+ | stp x28, x29, [sp, #( -16*2)]! // we have to store RX (x28)
2327
+ | // stp x26, x27, [sp, #-16]! // we don't use callee-saved registers yet
2328
+ | // stp x24, x25, [sp, #-16]!
2329
+ | // stp x22, x23, [sp, #-16]!
2330
+ | // stp x20, x21, [sp, #-16]!
2331
+ | // stp x18, x19, [sp, #-16]!
2332
+ | // stp x16, x17, [sp, #-16]! // we don't need temporary registers
2333
+ | stp x14, x15, [sp, #-(16*7) ]!
2334
2334
| stp x12, x13, [sp, #-16]!
2335
2335
| stp x10, x11, [sp, #-16]!
2336
2336
| stp x8, x9, [sp, #-16]!
@@ -2339,15 +2339,15 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst)
2339
2339
| stp x2, x3, [sp, #-16]!
2340
2340
| stp x0, x1, [sp, #-16]!
2341
2341
|
2342
- | ldr FCARG1w, [sp, #(32 * 16)] // exit_num = POP
2342
+ | mov FCARG1w, TMP1w // exit_num
2343
2343
| mov FCARG2x, sp
2344
2344
|
2345
2345
| // EX(opline) = opline
2346
2346
| SAVE_IP
2347
2347
| // zend_jit_trace_exit(trace_num, exit_num)
2348
2348
| EXT_CALL zend_jit_trace_exit, REG0
2349
2349
|
2350
- | add sp, sp, #(33 * 16) // including the pre-allocated 16 bytes
2350
+ | add sp, sp, #(32 * 16) // restore sp
2351
2351
|
2352
2352
2353
2353
| tst RETVALw, RETVALw
@@ -2442,25 +2442,26 @@ static int zend_jit_trace_escape_stub(dasm_State **Dst)
2442
2442
}
2443
2443
2444
2444
/* Keep 32 exit points in a single code block */
2445
- #define ZEND_JIT_EXIT_POINTS_SPACING 12 // mov + strb + b = bytes
2445
+ #define ZEND_JIT_EXIT_POINTS_SPACING 4 // bl = bytes
2446
2446
#define ZEND_JIT_EXIT_POINTS_PER_GROUP 32 // number of continuous exit points
2447
2447
2448
2448
static int zend_jit_trace_exit_group_stub(dasm_State **Dst, uint32_t n)
2449
2449
{
2450
2450
uint32_t i;
2451
2451
2452
- for (i = 0; i < ZEND_JIT_EXIT_POINTS_PER_GROUP - 1; i++) {
2453
- | mov TMP1w, #i
2454
- | strb TMP1w, [sp, #-16]!
2455
- | b >1
2456
- }
2457
- | mov TMP1w, #i
2458
- | strb TMP1w, [sp, #-16]!
2452
+ | bl >2
2459
2453
|1:
2460
- | ldrb TMP1w, [sp]
2461
- | ADD_SUB_32_WITH_CONST add, TMP1w, TMP1w, n, TMP2w
2462
- | str TMP1w, [sp]
2463
- | b ->trace_exit
2454
+ for (i = 1; i < ZEND_JIT_EXIT_POINTS_PER_GROUP; i++) {
2455
+ | bl >2
2456
+ }
2457
+ |2:
2458
+ | adr TMP1, <1
2459
+ | sub TMP1, lr, TMP1
2460
+ | lsr TMP1, TMP1, #2
2461
+ if (n) {
2462
+ | ADD_SUB_32_WITH_CONST add, TMP1w, TMP1w, n, TMP2w
2463
+ }
2464
+ | b ->trace_exit // pass exit_num in TMP1w
2464
2465
2465
2466
return 1;
2466
2467
}
0 commit comments