@@ -5038,6 +5038,11 @@ int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const
5038
5038
return 0 ;
5039
5039
}
5040
5040
5041
+ if (JIT_G (tracing )) {
5042
+ ++ (* ZEND_OP_TRACE_INFO (opline , offset )-> counter );
5043
+ return 0 ;
5044
+ }
5045
+
5041
5046
if (JIT_G (debug ) & ZEND_JIT_DEBUG_TRACE_START ) {
5042
5047
fprintf (stderr , "---- TRACE %d start (%s) %s() %s:%d\n" ,
5043
5048
trace_num ,
@@ -5053,8 +5058,10 @@ int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const
5053
5058
goto abort ;
5054
5059
}
5055
5060
5061
+ JIT_G (tracing ) = 1 ;
5056
5062
stop = zend_jit_trace_execute (execute_data , opline , trace_buffer ,
5057
5063
ZEND_OP_TRACE_INFO (opline , offset )-> trace_flags & ZEND_JIT_TRACE_START_MASK , 0 );
5064
+ JIT_G (tracing ) = 0 ;
5058
5065
5059
5066
if (UNEXPECTED (JIT_G (debug ) & ZEND_JIT_DEBUG_TRACE_BYTECODE )) {
5060
5067
zend_jit_dump_trace (trace_buffer , NULL );
@@ -5335,7 +5342,9 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3
5335
5342
}
5336
5343
}
5337
5344
5345
+ JIT_G (tracing ) = 1 ;
5338
5346
stop = zend_jit_trace_execute (execute_data , EX (opline ), trace_buffer , ZEND_JIT_TRACE_START_SIDE , is_megamorphic );
5347
+ JIT_G (tracing ) = 0 ;
5339
5348
5340
5349
if (UNEXPECTED (JIT_G (debug ) & ZEND_JIT_DEBUG_TRACE_BYTECODE )) {
5341
5350
zend_jit_dump_trace (trace_buffer , NULL );
@@ -5468,7 +5477,7 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
5468
5477
EX (opline ) = opline ;
5469
5478
}
5470
5479
5471
- if (EG (vm_interrupt )) {
5480
+ if (EG (vm_interrupt ) || JIT_G ( tracing ) ) {
5472
5481
return 1 ;
5473
5482
/* Lock-free check if the side trace was already JIT-ed or blacklist-ed in another process */
5474
5483
} else if (t -> exit_info [exit_num ].flags & (ZEND_JIT_EXIT_JITED |ZEND_JIT_EXIT_BLACKLISTED )) {
@@ -5607,6 +5616,7 @@ static void zend_jit_trace_init_caches(void)
5607
5616
5608
5617
static void zend_jit_trace_reset_caches (void )
5609
5618
{
5619
+ JIT_G (tracing ) = 0 ;
5610
5620
}
5611
5621
5612
5622
static void zend_jit_trace_restart (void )
0 commit comments