From c60d0dc2f41f1d4817414e37a39ae87c5677e31a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 9 Jul 2020 19:39:12 +0300 Subject: [PATCH] Make tracing JIT to support operator overloading independently from opcache.optimization_level ini directive. --- ext/opcache/jit/zend_jit.c | 8 +++----- ext/opcache/jit/zend_jit_trace.c | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 0031dc6731..8c46cf9676 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -684,15 +684,13 @@ static int zend_jit_op_array_analyze1(const zend_op_array *op_array, zend_script return SUCCESS; } -static int zend_jit_op_array_analyze2(const zend_op_array *op_array, zend_script *script, zend_ssa *ssa) +static int zend_jit_op_array_analyze2(const zend_op_array *op_array, zend_script *script, zend_ssa *ssa, uint32_t optimization_level) { if ((JIT_G(opt_level) >= ZEND_JIT_LEVEL_OPT_FUNC) && ssa->cfg.blocks && op_array->last_try_catch == 0 && !(op_array->fn_flags & ZEND_ACC_GENERATOR) && !(ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) { - - uint32_t optimization_level = ZCG(accel_directives).optimization_level; if (zend_ssa_inference(&CG(arena), op_array, script, ssa, optimization_level) != SUCCESS) { return FAILURE; } @@ -3133,7 +3131,7 @@ static int zend_real_jit_func(zend_op_array *op_array, zend_script *script, cons } } - if (zend_jit_op_array_analyze2(op_array, script, &ssa) != SUCCESS) { + if (zend_jit_op_array_analyze2(op_array, script, &ssa, ZCG(accel_directives).optimization_level) != SUCCESS) { goto jit_failure; } @@ -3458,7 +3456,7 @@ ZEND_EXT_API int zend_jit_script(zend_script *script) } info = ZEND_FUNC_INFO(call_graph.op_arrays[i]); if (info) { - if (zend_jit_op_array_analyze2(call_graph.op_arrays[i], script, &info->ssa) != SUCCESS) { + if (zend_jit_op_array_analyze2(call_graph.op_arrays[i], script, &info->ssa, ZCG(accel_directives).optimization_level) != SUCCESS) { goto jit_failure; } info->flags = info->ssa.cfg.flags; diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index b1d910c534..8bbd3debee 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -492,7 +492,7 @@ static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_sc } } - if (zend_jit_op_array_analyze2(op_array, script, ssa) != SUCCESS) { + if (zend_jit_op_array_analyze2(op_array, script, ssa, 0) != SUCCESS) { break; } @@ -919,7 +919,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin int i, v, idx, len, ssa_ops_count, vars_count, ssa_vars_count; zend_jit_trace_stack *stack; uint32_t build_flags = ZEND_SSA_RC_INFERENCE | ZEND_SSA_USE_CV_RESULTS; - uint32_t optimization_level = ZCG(accel_directives).optimization_level; + uint32_t optimization_level = 0; int call_level, level, num_op_arrays; size_t frame_size, stack_top, stack_size, stack_bottom; zend_jit_op_array_trace_extension *jit_extension; -- 2.40.0