From: Dmitry Stogov Date: Mon, 20 Jul 2020 22:49:01 +0000 (+0300) Subject: Fixed tracing JIT exception handling X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cfb141f9d35f3ce888f160626c47a55044ac573;p=php Fixed tracing JIT exception handling --- diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index b5c58ce6b7..4a8d5ba3b0 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -1691,13 +1691,25 @@ static int zend_jit_exception_handler_stub(dasm_State **Dst) if (GCC_GLOBAL_REGS) { | add r4, SPAD // stack alignment + | EXT_JMP handler, r0 + } else if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) { + | mov FCARG1a, FP + | EXT_CALL handler, r0 + | mov FP, aword T2 // restore FP + | mov RX, aword T3 // restore IP + | add r4, NR_SPAD // stack alignment + | test eax, eax + | jl >1 + | mov r0, 1 // ZEND_VM_ENTER + |1: + | ret } else { | mov FCARG1a, FP | mov FP, aword T2 // restore FP | mov RX, aword T3 // restore IP | add r4, NR_SPAD // stack alignment + | EXT_JMP handler, r0 } - | EXT_JMP handler, r0 } return 1; @@ -2487,6 +2499,8 @@ static int zend_jit_trace_exit_stub(dasm_State **Dst) | mov r0, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])] | mov r0, aword [r0 + offsetof(zend_jit_op_array_trace_extension, offset)] | call aword [IP + r0] + | test eax, eax + | jl ->trace_halt | mov FP, aword T2 // restore FP | mov RX, aword T3 // restore IP | add r4, NR_SPAD // stack alignment