Skip to content

Commit fd56fd2

Browse files
committed
Always record ZEND_JIT_TRACE_START and ZEND_JIT_TRACE_END
1 parent 226617d commit fd56fd2

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,6 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
594594
#endif
595595
zend_execute_data *prev_call = EX(call);
596596

597-
if (UNEXPECTED(opline->opcode == ZEND_HANDLE_EXCEPTION)) {
598-
/* Abort trace because of exception */
599-
#ifdef HAVE_GCC_GLOBAL_REGS
600-
execute_data = save_execute_data;
601-
opline = save_opline;
602-
#endif
603-
return ZEND_JIT_TRACE_STOP_EXCEPTION;
604-
}
605-
606597
orig_opline = opline;
607598

608599
op_array = &EX(func)->op_array;
@@ -616,9 +607,20 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
616607

617608
TRACE_START(ZEND_JIT_TRACE_START, start, op_array, opline);
618609

610+
if (UNEXPECTED(opline->opcode == ZEND_HANDLE_EXCEPTION)) {
611+
/* Abort trace because of exception */
612+
TRACE_END(ZEND_JIT_TRACE_END, ZEND_JIT_TRACE_STOP_EXCEPTION, opline);
613+
#ifdef HAVE_GCC_GLOBAL_REGS
614+
execute_data = save_execute_data;
615+
opline = save_opline;
616+
#endif
617+
return ZEND_JIT_TRACE_STOP_EXCEPTION;
618+
}
619+
619620
if (prev_call) {
620621
int ret = zend_jit_trace_record_fake_init_call(prev_call, trace_buffer, idx, is_megamorphic, &megamorphic, ret_level + level);
621622
if (ret < 0) {
623+
TRACE_END(ZEND_JIT_TRACE_END, ZEND_JIT_TRACE_STOP_BAD_FUNC, opline);
622624
#ifdef HAVE_GCC_GLOBAL_REGS
623625
execute_data = save_execute_data;
624626
opline = save_opline;

0 commit comments

Comments
 (0)