From 4a57ad7df148557d42663224a7776f9a0ea26778 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 16 Oct 2024 10:55:57 +0300 Subject: [PATCH] Stop trace recording only on ENTER to FAKE_CLOSURE (continue on EXIT) --- ext/opcache/jit/zend_jit_vm_helpers.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 70122eb9736e..165896acbdae 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -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; } @@ -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);