@@ -9986,7 +9986,7 @@ static int zend_jit_free_op(dasm_State **Dst, const zend_op *opline, /*const zen
9986
9986
return 1;
9987
9987
}
9988
9988
9989
- static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_jit_trace_rec *trace, zend_jit_trace_info *trace_info)
9989
+ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_jit_trace_rec *trace, zend_jit_trace_info *trace_info, int may_throw )
9990
9990
{
9991
9991
/* ZEND_CALL_FAKE_CLOSURE handled on slow path to eliminate check for ZEND_CALL_CLOSURE on fast path */
9992
9992
| mov FCARG1d, dword [FP + offsetof(zend_execute_data, This.u1.type_info)]
@@ -10055,13 +10055,20 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const ze
10055
10055
&& (JIT_G(current_frame) && !TRACE_FRAME_IS_UNKNOWN_RETURN(JIT_G(current_frame)))) {
10056
10056
zend_jit_reset_opline(Dst, NULL);
10057
10057
} else {
10058
- // TODO: exception handling for tracing JIT ???
10059
10058
| LOAD_OPLINE
10060
10059
| ADD_IP sizeof(zend_op)
10061
10060
}
10062
10061
10063
10062
|8:
10064
10063
10064
+ if ((trace->op != ZEND_JIT_TRACE_END ||
10065
+ trace->stop != ZEND_JIT_TRACE_STOP_RECURSIVE_RET) &&
10066
+ may_throw) {
10067
+ | // if (EG(exception))
10068
+ | MEM_OP2_1_ZTS cmp, aword, executor_globals, exception, 0, r0
10069
+ | jne ->leave_throw_handler
10070
+ }
10071
+
10065
10072
if (trace->op == ZEND_JIT_TRACE_BACK
10066
10073
&& (!JIT_G(current_frame) || TRACE_FRAME_IS_UNKNOWN_RETURN(JIT_G(current_frame)))) {
10067
10074
const zend_op *next_opline = trace->opline;
@@ -10074,6 +10081,7 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const ze
10074
10081
} while (trace->op == ZEND_JIT_TRACE_INIT_CALL);
10075
10082
ZEND_ASSERT(trace->op == ZEND_JIT_TRACE_VM || trace->op == ZEND_JIT_TRACE_END);
10076
10083
next_opline = trace->opline;
10084
+ ZEND_ASSERT(next_opline != NULL);
10077
10085
current_frame = JIT_G(current_frame);
10078
10086
JIT_G(current_frame) = NULL;
10079
10087
exit_point = zend_jit_trace_get_exit_point(opline, NULL, trace, 0);
@@ -10082,7 +10090,6 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const ze
10082
10090
if (!exit_addr) {
10083
10091
return 0;
10084
10092
}
10085
- | // TODO: exception handling ???
10086
10093
if (trace->op == ZEND_JIT_TRACE_END
10087
10094
&& trace->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET) {
10088
10095
trace_info->flags |= ZEND_JIT_TRACE_LOOP;
0 commit comments