Skip to content

Commit 6442cbf

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: JIT: Fixed failures of tracing JIT with CALL VM
2 parents 8351734 + 1082669 commit 6442cbf

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,11 @@ static int zend_jit_set_ip(dasm_State **Dst, const zend_op *opline)
28472847
return 1;
28482848
}
28492849

2850+
static int zend_jit_set_ip_ex(dasm_State **Dst, const zend_op *opline, bool set_ip_reg)
2851+
{
2852+
return zend_jit_set_ip(Dst, opline);
2853+
}
2854+
28502855
static int zend_jit_set_valid_ip(dasm_State **Dst, const zend_op *opline)
28512856
{
28522857
if (delayed_call_chain) {

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6431,11 +6431,11 @@ static const void *zend_jit_trace_exit_to_vm(uint32_t trace_num, uint32_t exit_n
64316431

64326432
opline = zend_jit_traces[trace_num].exit_info[exit_num].opline;
64336433
if (opline) {
6434-
zend_jit_set_ip(&dasm_state, opline);
64356434
if (opline == zend_jit_traces[zend_jit_traces[trace_num].root].opline) {
64366435
/* prevent endless loop */
64376436
original_handler = 1;
64386437
}
6438+
zend_jit_set_ip_ex(&dasm_state, opline, original_handler);
64396439
}
64406440

64416441
zend_jit_trace_return(&dasm_state, original_handler);

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,24 @@ static int zend_jit_set_ip(dasm_State **Dst, const zend_op *opline)
30583058
return 1;
30593059
}
30603060

3061+
static int zend_jit_set_ip_ex(dasm_State **Dst, const zend_op *opline, bool set_ip_reg)
3062+
{
3063+
if (last_valid_opline == opline) {
3064+
zend_jit_use_last_valid_opline();
3065+
} else if (GCC_GLOBAL_REGS && last_valid_opline) {
3066+
zend_jit_use_last_valid_opline();
3067+
| ADD_IP (opline - last_valid_opline) * sizeof(zend_op);
3068+
} else if (!GCC_GLOBAL_REGS && set_ip_reg) {
3069+
| LOAD_ADDR RX, opline
3070+
| mov aword EX->opline, RX
3071+
} else {
3072+
| LOAD_IP_ADDR opline
3073+
}
3074+
zend_jit_set_last_valid_opline(opline);
3075+
3076+
return 1;
3077+
}
3078+
30613079
static int zend_jit_set_valid_ip(dasm_State **Dst, const zend_op *opline)
30623080
{
30633081
if (delayed_call_chain) {

0 commit comments

Comments
 (0)