@@ -4213,16 +4213,19 @@ static void zend_jit_cleanup_func_info(zend_op_array *op_array)
4213
4213
}
4214
4214
}
4215
4215
4216
- static int zend_real_jit_func (zend_op_array * op_array , zend_script * script , const zend_op * rt_opline )
4216
+ static int zend_real_jit_func (zend_op_array * op_array , zend_script * script , const zend_op * rt_opline , uint8_t trigger )
4217
4217
{
4218
4218
zend_ssa ssa ;
4219
4219
void * checkpoint ;
4220
4220
zend_func_info * func_info ;
4221
+ uint8_t orig_trigger ;
4221
4222
4222
4223
if (* dasm_ptr == dasm_end ) {
4223
4224
return FAILURE ;
4224
4225
}
4225
4226
4227
+ orig_trigger = JIT_G (trigger );
4228
+ JIT_G (trigger ) = trigger ;
4226
4229
checkpoint = zend_arena_checkpoint (CG (arena ));
4227
4230
4228
4231
/* Build SSA */
@@ -4255,11 +4258,13 @@ static int zend_real_jit_func(zend_op_array *op_array, zend_script *script, cons
4255
4258
4256
4259
zend_jit_cleanup_func_info (op_array );
4257
4260
zend_arena_release (& CG (arena ), checkpoint );
4261
+ JIT_G (trigger ) = orig_trigger ;
4258
4262
return SUCCESS ;
4259
4263
4260
4264
jit_failure :
4261
4265
zend_jit_cleanup_func_info (op_array );
4262
4266
zend_arena_release (& CG (arena ), checkpoint );
4267
+ JIT_G (trigger ) = orig_trigger ;
4263
4268
return FAILURE ;
4264
4269
}
4265
4270
@@ -4290,7 +4295,7 @@ static int ZEND_FASTCALL zend_runtime_jit(void)
4290
4295
opline -> handler = jit_extension -> orig_handler ;
4291
4296
4292
4297
/* perform real JIT for this function */
4293
- zend_real_jit_func (op_array , NULL , NULL );
4298
+ zend_real_jit_func (op_array , NULL , NULL , ZEND_JIT_ON_FIRST_EXEC );
4294
4299
} zend_catch {
4295
4300
do_bailout = true;
4296
4301
} zend_end_try ();
@@ -4336,7 +4341,7 @@ void zend_jit_check_funcs(HashTable *function_table, bool is_method) {
4336
4341
jit_extension = (zend_jit_op_array_extension * )ZEND_FUNC_INFO (op_array );
4337
4342
opline -> handler = jit_extension -> orig_handler ;
4338
4343
if (((double )counter / (double )zend_jit_profile_counter ) > JIT_G (prof_threshold )) {
4339
- zend_real_jit_func (op_array , NULL , NULL );
4344
+ zend_real_jit_func (op_array , NULL , NULL , ZEND_JIT_ON_PROF_REQUEST );
4340
4345
}
4341
4346
}
4342
4347
} ZEND_HASH_FOREACH_END ();
@@ -4362,7 +4367,7 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend
4362
4367
}
4363
4368
4364
4369
/* perform real JIT for this function */
4365
- zend_real_jit_func (op_array , NULL , opline );
4370
+ zend_real_jit_func (op_array , NULL , opline , ZEND_JIT_ON_HOT_COUNTERS );
4366
4371
} zend_catch {
4367
4372
do_bailout = 1 ;
4368
4373
} zend_end_try ();
@@ -4530,7 +4535,7 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script)
4530
4535
} else if (JIT_G (trigger ) == ZEND_JIT_ON_HOT_TRACE ) {
4531
4536
return zend_jit_setup_hot_trace_counters (op_array );
4532
4537
} else if (JIT_G (trigger ) == ZEND_JIT_ON_SCRIPT_LOAD ) {
4533
- return zend_real_jit_func (op_array , script , NULL );
4538
+ return zend_real_jit_func (op_array , script , NULL , ZEND_JIT_ON_SCRIPT_LOAD );
4534
4539
} else {
4535
4540
ZEND_UNREACHABLE ();
4536
4541
}
0 commit comments