]> granicus.if.org Git - php/commitdiff
Make tracing JIT to support operator overloading independently from opcache.optimizat...
authorDmitry Stogov <dmitry@zend.com>
Thu, 9 Jul 2020 16:39:12 +0000 (19:39 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 9 Jul 2020 16:39:12 +0000 (19:39 +0300)
ext/opcache/jit/zend_jit.c
ext/opcache/jit/zend_jit_trace.c

index 0031dc6731b3885e8a156329154541bbba7103bf..8c46cf9676a98275acd3a17a8805aa34b532897c 100644 (file)
@@ -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;
index b1d910c53491804db9eaa8974ace1bb230b5b46a..8bbd3debeebc5cff623d7fc84129e90440272d8d 100644 (file)
@@ -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;