Skip to content

Commit 7cfb141

Browse files
committed
Fixed tracing JIT exception handling
1 parent 19bf66a commit 7cfb141

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,13 +1691,25 @@ static int zend_jit_exception_handler_stub(dasm_State **Dst)
16911691

16921692
if (GCC_GLOBAL_REGS) {
16931693
| add r4, SPAD // stack alignment
1694+
| EXT_JMP handler, r0
1695+
} else if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
1696+
| mov FCARG1a, FP
1697+
| EXT_CALL handler, r0
1698+
| mov FP, aword T2 // restore FP
1699+
| mov RX, aword T3 // restore IP
1700+
| add r4, NR_SPAD // stack alignment
1701+
| test eax, eax
1702+
| jl >1
1703+
| mov r0, 1 // ZEND_VM_ENTER
1704+
|1:
1705+
| ret
16941706
} else {
16951707
| mov FCARG1a, FP
16961708
| mov FP, aword T2 // restore FP
16971709
| mov RX, aword T3 // restore IP
16981710
| add r4, NR_SPAD // stack alignment
1711+
| EXT_JMP handler, r0
16991712
}
1700-
| EXT_JMP handler, r0
17011713
}
17021714

17031715
return 1;
@@ -2487,6 +2499,8 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst)
24872499
| mov r0, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])]
24882500
| mov r0, aword [r0 + offsetof(zend_jit_op_array_trace_extension, offset)]
24892501
| call aword [IP + r0]
2502+
| test eax, eax
2503+
| jl ->trace_halt
24902504
| mov FP, aword T2 // restore FP
24912505
| mov RX, aword T3 // restore IP
24922506
| add r4, NR_SPAD // stack alignment

0 commit comments

Comments
 (0)