Skip to content

Commit

Permalink
Stop trace recording only on ENTER to FAKE_CLOSURE (continue on EXIT) (
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov authored Oct 16, 2024
1 parent 99aa43a commit 6d9f040
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/opcache/jit/zend_jit_vm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,7 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
if (UNEXPECTED(!jit_extension)
|| UNEXPECTED(!(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE))
|| (op_array->fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
|| UNEXPECTED(!(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE))) {
stop = ZEND_JIT_TRACE_STOP_INTERPRETER;
break;
}
Expand Down Expand Up @@ -995,6 +994,11 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
break;
}

if (EX(func)->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE) {
stop = ZEND_JIT_TRACE_STOP_INTERPRETER;
break;
}

TRACE_RECORD(ZEND_JIT_TRACE_ENTER,
EX(return_value) != NULL ? ZEND_JIT_TRACE_RETURN_VALUE_USED : 0,
op_array);
Expand Down

0 comments on commit 6d9f040

Please sign in to comment.