Skip to content

Commit ab6865c

Browse files
committed
Allow %rpb ysage in JIT for CALL VM (we save and restore it in prologue/epilogue anyway)
1 parent 2bf5ba9 commit ab6865c

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

ext/opcache/jit/ir

Submodule ir updated 1 file

ext/opcache/jit/zend_jit_ir.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,12 @@
3636
# define ZREG_IP 28 /* IR_REG_X28 */
3737
# define ZREG_FIRST_FPR 32
3838
# define IR_REGSET_PRESERVED ((1<<19) | (1<<20) | (1<<21) | (1<<22) | (1<<23) | (1<<24) | \
39-
(1<<25) | (1<<26) | (1<<27) | (1<<29) | (1<<30)) /* all preserved registers */
39+
(1<<25) | (1<<26) | (1<<27) | (1<<28) | (1<<29) | (1<<30)) /* all preserved registers */
4040
#else
4141
# error "Unknown IR target"
4242
#endif
4343

44-
#define ZREG_RX ZREG_IP
45-
46-
#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
47-
# define IR_REGSET_PHP_FIXED ((1<<ZREG_FP) | (1<<ZREG_IP) | (1<<5)) /* prevent %rbp (%r5) usage */
48-
#else
49-
# define IR_REGSET_PHP_FIXED ((1<<ZREG_FP) | (1<<ZREG_IP))
50-
#endif
44+
#define ZREG_RX ZREG_IP
5145

5246
#ifdef ZEND_ENABLE_ZVAL_LONG64
5347
# define IR_PHP_LONG IR_I64
@@ -3341,6 +3335,7 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
33413335
#endif
33423336
jit->ctx.flags |= flags | IR_OPT_FOLDING | IR_OPT_CFG | IR_OPT_CODEGEN | IR_HAS_CALLS;
33433337

3338+
jit->ctx.fixed_regset = (1<<ZREG_FP) | (1<<ZREG_IP);
33443339
if (!(flags & IR_FUNCTION)) {
33453340
jit->ctx.flags |= IR_NO_STACK_COMBINE;
33463341
if (zend_jit_vm_kind == ZEND_VM_KIND_CALL) {
@@ -3359,10 +3354,12 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
33593354
#else
33603355
jit->ctx.fixed_stack_red_zone = 0;
33613356
jit->ctx.fixed_stack_frame_size = 0;
3357+
#endif
3358+
#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
3359+
jit->ctx.fixed_regset |= (1<<5); /* prevent %rbp (%r5) usage */
33623360
#endif
33633361
}
33643362
}
3365-
jit->ctx.fixed_regset = IR_REGSET_PHP_FIXED;
33663363
jit->op_array = NULL;
33673364
jit->ssa = NULL;
33683365
jit->name = NULL;

0 commit comments

Comments
 (0)