]> granicus.if.org Git - php/commitdiff
Add opcache.jit=tracing|function values, make on/yes/true synonym for tracing.
authorBenjamin Eberlei <kontakt@beberlei.de>
Fri, 31 Jul 2020 11:27:32 +0000 (13:27 +0200)
committerBenjamin Eberlei <kontakt@beberlei.de>
Tue, 4 Aug 2020 08:15:22 +0000 (10:15 +0200)
ext/opcache/jit/zend_jit.c
ext/opcache/jit/zend_jit.h
ext/opcache/zend_accelerator_module.c

index feff3de6d323bddef0ce13aa7e04e1403058aab3..e2e85f3431904aaee8c46c632d8fb0692b5fb660 100644 (file)
@@ -3750,16 +3750,24 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
                JIT_G(on) = 0;
                return SUCCESS;
        } else if (zend_string_equals_literal_ci(jit, "0")
-               || zend_string_equals_literal_ci(jit, "off")
-               || zend_string_equals_literal_ci(jit, "no")
-               || zend_string_equals_literal_ci(jit, "false")) {
+                       || zend_string_equals_literal_ci(jit, "off")
+                       || zend_string_equals_literal_ci(jit, "no")
+                       || zend_string_equals_literal_ci(jit, "false")) {
                JIT_G(enabled) = 1;
                JIT_G(on) = 0;
                return SUCCESS;
        } else if (zend_string_equals_literal_ci(jit, "1")
-               || zend_string_equals_literal_ci(jit, "on")
-               || zend_string_equals_literal_ci(jit, "yes")
-               || zend_string_equals_literal_ci(jit, "true")) {
+                       || zend_string_equals_literal_ci(jit, "on")
+                       || zend_string_equals_literal_ci(jit, "yes")
+                       || zend_string_equals_literal_ci(jit, "true")
+                       || zend_string_equals_literal_ci(jit, "tracing")) {
+               JIT_G(enabled) = 1;
+               JIT_G(on) = 1;
+               JIT_G(opt_level) = ZEND_JIT_LEVEL_OPT_FUNCS;
+               JIT_G(trigger) = ZEND_JIT_ON_HOT_TRACE;
+               JIT_G(opt_flags) = ZEND_JIT_REG_ALLOC_GLOBAL | ZEND_JIT_CPU_AVX;
+               return SUCCESS;
+       } else if (zend_string_equals_literal_ci(jit, "function")) {
                JIT_G(enabled) = 1;
                JIT_G(on) = 1;
                JIT_G(opt_level) = ZEND_JIT_LEVEL_OPT_SCRIPT;
index 7afcd613c07cddb9e2210ee32144850f1c8a5b3f..7ffc80ef36f30c5bf4e65bdaf33b83a26df5f82a 100644 (file)
@@ -37,7 +37,6 @@
 #define ZEND_JIT_REG_ALLOC_GLOBAL (1<<1) /* global linear scan register allocation */
 #define ZEND_JIT_CPU_AVX          (1<<2) /* use AVX instructions, if available */
 
-#define ZEND_JIT_DEFAULT_OPTIONS      "1254"
 #define ZEND_JIT_DEFAULT_BUFFER_SIZE  "0"
 
 #define ZEND_JIT_COUNTER_INIT         32531
index 7b243931b28b5146b207ae3e7a99ec176af5e6b2..4258ddd6864d2f0403b005f6aacb9b60e8bf4d7a 100644 (file)
@@ -287,14 +287,14 @@ ZEND_INI_BEGIN()
        STD_PHP_INI_ENTRY("opcache.cache_id"                      , ""    , PHP_INI_SYSTEM, OnUpdateString,           accel_directives.cache_id,               zend_accel_globals, accel_globals)
 #endif
 #ifdef HAVE_JIT
-       STD_PHP_INI_ENTRY("opcache.jit"                           , ZEND_JIT_DEFAULT_OPTIONS,     PHP_INI_ALL,    OnUpdateJit,      options,               zend_jit_globals, jit_globals)
+       STD_PHP_INI_ENTRY("opcache.jit"                           , "tracing",                    PHP_INI_ALL,    OnUpdateJit,      options,               zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_buffer_size"               , ZEND_JIT_DEFAULT_BUFFER_SIZE, PHP_INI_SYSTEM, OnUpdateLong,     buffer_size,           zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_debug"                     , "0",                          PHP_INI_ALL,    OnUpdateJitDebug, debug,                 zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_bisect_limit"              , "0",                          PHP_INI_ALL,    OnUpdateLong,     bisect_limit,          zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_prof_threshold"            , "0.005",                      PHP_INI_ALL,    OnUpdateReal,     prof_threshold,        zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_max_root_traces"           , "1024",                       PHP_INI_SYSTEM, OnUpdateLong,     max_root_traces,       zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_max_side_traces"           , "128",                        PHP_INI_SYSTEM, OnUpdateLong,     max_side_traces,       zend_jit_globals, jit_globals)
-       STD_PHP_INI_ENTRY("opcache.jit_max_exit_counters"         , "8192",                        PHP_INI_SYSTEM, OnUpdateLong,     max_exit_counters,     zend_jit_globals, jit_globals)
+       STD_PHP_INI_ENTRY("opcache.jit_max_exit_counters"         , "8192",                       PHP_INI_SYSTEM, OnUpdateLong,     max_exit_counters,     zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_hot_loop"                  , "64",                         PHP_INI_SYSTEM, OnUpdateCounter,  hot_loop,              zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_hot_func"                  , "127",                        PHP_INI_SYSTEM, OnUpdateCounter,  hot_func,              zend_jit_globals, jit_globals)
        STD_PHP_INI_ENTRY("opcache.jit_hot_return"                , "8",                          PHP_INI_SYSTEM, OnUpdateCounter,  hot_return,            zend_jit_globals, jit_globals)