Skip to content

Commit aecb05f

Browse files
committed
Give preference to ENTER->RECURSIVE_CALL trace over ENTER->RETURN
1 parent 26af806 commit aecb05f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ext/opcache/jit/zend_jit_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ int ZEND_FASTCALL zend_jit_check_constant(const zval *key);
157157
_(DEEP_RECURSION, "deep recursion") \
158158
_(LOOP_UNROLL, "loop unroll limit reached") \
159159
_(LOOP_EXIT, "exit from loop") \
160+
_(RECURSION_EXIT, "return from recursive function") \
160161
_(BLACK_LIST, "trace blacklisted") \
161162
_(INNER_LOOP, "inner loop") /* trace it */ \
162163
_(COMPILED_LOOP, "compiled loop") \

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,13 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
864864
If this doesn't work terminate it. */
865865
stop = ZEND_JIT_TRACE_STOP_LOOP_EXIT;
866866
break;
867+
} else if (start & ZEND_JIT_TRACE_START_ENTER
868+
&& EX(prev_execute_data)
869+
&& EX(func) == EX(prev_execute_data)->func
870+
&& zend_jit_trace_bad_stop_event(orig_opline, JIT_G(blacklist_root_trace) - 1) !=
871+
ZEND_JIT_TRACE_STOP_RECURSION_EXIT) {
872+
stop = ZEND_JIT_TRACE_STOP_RECURSION_EXIT;
873+
break;
867874
} else {
868875
stop = ZEND_JIT_TRACE_STOP_RETURN;
869876
break;

0 commit comments

Comments
 (0)