From c327728a5ca68802a1522406845a97961881935b Mon Sep 17 00:00:00 2001 From: wxue1 Date: Fri, 28 Oct 2022 00:53:32 -0700 Subject: [PATCH] Stop side exit tracing when reach max_root_trace. When max_root_trace is reached, JIT in tracing mode will not compile any new code for side trace, but side exit tracing is still going on. We stop it directly instead of lazy blacklisting. Signed-off-by: Wang, Xue xue1.wang@intel.com --- ext/opcache/jit/zend_jit_trace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 892902a4e03a6..165c5b970e7ca 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -7744,6 +7744,15 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 if (ZEND_JIT_TRACE_NUM >= JIT_G(max_root_traces)) { stop = ZEND_JIT_TRACE_STOP_TOO_MANY_TRACES; + // visit all JITTed compiled code, replace side exit to vm handler + for (uint32_t i = 1; i < ZEND_JIT_TRACE_NUM; i++) { + for (uint32_t j = 0; j < zend_jit_traces[i].exit_count; j++) { + zend_jit_blacklist_trace_exit(i, j); + } + } + if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_BLACKLIST) { + fprintf(stderr, "---- All side exits blacklisted"); + } goto abort; }