@@ -2605,11 +2605,13 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
2605
2605
/* Stack must be 16 byte aligned */
2606
2606
/* TODO: select stack size ??? */
2607
2607
#if defined(IR_TARGET_AARCH64)
2608
- jit->ctx.fixed_stack_frame_size = sizeof(void*) * 16;
2608
+ jit->ctx.fixed_stack_frame_size = sizeof(void*) * 16; /* 10 saved registers and 6 spill slots (8 bytes) */
2609
2609
#elif defined(_WIN64)
2610
- jit->ctx.fixed_stack_frame_size = sizeof(void*) * 15;
2611
- #else
2612
- jit->ctx.fixed_stack_frame_size = sizeof(void*) * 7;
2610
+ jit->ctx.fixed_stack_frame_size = sizeof(void*) * 11; /* 8 saved registers and 3 spill slots (8 bytes) */
2611
+ #elif defined(IR_TARGET_X86_64)
2612
+ jit->ctx.fixed_stack_frame_size = sizeof(void*) * 9; /* 6 saved registers and 3 spill slots (8 bytes) */
2613
+ #else /* IR_TARGET_x86 */
2614
+ jit->ctx.fixed_stack_frame_size = sizeof(void*) * 11; /* 4 saved registers and 7 spill slots (4 bytes) */
2613
2615
#endif
2614
2616
if (GCC_GLOBAL_REGS) {
2615
2617
jit->ctx.fixed_save_regset = IR_REGSET_PRESERVED & ~((1<<ZREG_FP) | (1<<ZREG_IP));
@@ -2619,6 +2621,7 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
2619
2621
// jit->ctx.fixed_save_regset &= 0xffff; // TODO: don't save FP registers ???
2620
2622
//#endif
2621
2623
}
2624
+ jit->ctx.fixed_call_stack_size = 16;
2622
2625
} else {
2623
2626
#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE
2624
2627
jit->ctx.fixed_stack_red_zone = ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE;
@@ -2629,7 +2632,7 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
2629
2632
jit->ctx.flags |= IR_MERGE_EMPTY_ENTRIES;
2630
2633
#else
2631
2634
jit->ctx.fixed_stack_red_zone = 0;
2632
- jit->ctx.fixed_stack_frame_size = 16;
2635
+ jit->ctx.fixed_stack_frame_size = 32; /* 4 spill slots (8 bytes) or 8 spill slots (4 bytes) */
2633
2636
jit->ctx.fixed_call_stack_size = 16;
2634
2637
#endif
2635
2638
#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
0 commit comments