Skip to content

Commit

Permalink
Fixed tracing JIT exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Jul 20, 2020
1 parent 19bf66a commit 7cfb141
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7cfb141

Please sign in to comment.