Skip to content

Commit 00e8965

Browse files
committed
Add opcache.jit=tracing|function values, make on/yes/true synonym for tracing.
1 parent d3a9e15 commit 00e8965

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,16 +3729,24 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
37293729
JIT_G(on) = 0;
37303730
return SUCCESS;
37313731
} else if (zend_string_equals_literal_ci(jit, "0")
3732-
|| zend_string_equals_literal_ci(jit, "off")
3733-
|| zend_string_equals_literal_ci(jit, "no")
3734-
|| zend_string_equals_literal_ci(jit, "false")) {
3732+
|| zend_string_equals_literal_ci(jit, "off")
3733+
|| zend_string_equals_literal_ci(jit, "no")
3734+
|| zend_string_equals_literal_ci(jit, "false")) {
37353735
JIT_G(enabled) = 1;
37363736
JIT_G(on) = 0;
37373737
return SUCCESS;
37383738
} else if (zend_string_equals_literal_ci(jit, "1")
3739-
|| zend_string_equals_literal_ci(jit, "on")
3740-
|| zend_string_equals_literal_ci(jit, "yes")
3741-
|| zend_string_equals_literal_ci(jit, "true")) {
3739+
|| zend_string_equals_literal_ci(jit, "on")
3740+
|| zend_string_equals_literal_ci(jit, "yes")
3741+
|| zend_string_equals_literal_ci(jit, "true")
3742+
|| zend_string_equals_literal_ci(jit, "tracing")) {
3743+
JIT_G(enabled) = 1;
3744+
JIT_G(on) = 1;
3745+
JIT_G(opt_level) = ZEND_JIT_LEVEL_OPT_FUNCS;
3746+
JIT_G(trigger) = ZEND_JIT_ON_HOT_TRACE;
3747+
JIT_G(opt_flags) = ZEND_JIT_REG_ALLOC_GLOBAL | ZEND_JIT_CPU_AVX;
3748+
return SUCCESS;
3749+
} else if (zend_string_equals_literal_ci(jit, "function")) {
37423750
JIT_G(enabled) = 1;
37433751
JIT_G(on) = 1;
37443752
JIT_G(opt_level) = ZEND_JIT_LEVEL_OPT_SCRIPT;

ext/opcache/jit/zend_jit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#define ZEND_JIT_REG_ALLOC_GLOBAL (1<<1) /* global linear scan register allocation */
3838
#define ZEND_JIT_CPU_AVX (1<<2) /* use AVX instructions, if available */
3939

40-
#define ZEND_JIT_DEFAULT_OPTIONS "1254"
4140
#define ZEND_JIT_DEFAULT_BUFFER_SIZE "0"
4241

4342
#define ZEND_JIT_COUNTER_INIT 32531

ext/opcache/zend_accelerator_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,14 @@ ZEND_INI_BEGIN()
287287
STD_PHP_INI_ENTRY("opcache.cache_id" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.cache_id, zend_accel_globals, accel_globals)
288288
#endif
289289
#ifdef HAVE_JIT
290-
STD_PHP_INI_ENTRY("opcache.jit" , ZEND_JIT_DEFAULT_OPTIONS, PHP_INI_ALL, OnUpdateJit, options, zend_jit_globals, jit_globals)
290+
STD_PHP_INI_ENTRY("opcache.jit" , "tracing", PHP_INI_ALL, OnUpdateJit, options, zend_jit_globals, jit_globals)
291291
STD_PHP_INI_ENTRY("opcache.jit_buffer_size" , ZEND_JIT_DEFAULT_BUFFER_SIZE, PHP_INI_SYSTEM, OnUpdateLong, buffer_size, zend_jit_globals, jit_globals)
292292
STD_PHP_INI_ENTRY("opcache.jit_debug" , "0", PHP_INI_ALL, OnUpdateJitDebug, debug, zend_jit_globals, jit_globals)
293293
STD_PHP_INI_ENTRY("opcache.jit_bisect_limit" , "0", PHP_INI_ALL, OnUpdateLong, bisect_limit, zend_jit_globals, jit_globals)
294294
STD_PHP_INI_ENTRY("opcache.jit_prof_threshold" , "0.005", PHP_INI_ALL, OnUpdateReal, prof_threshold, zend_jit_globals, jit_globals)
295295
STD_PHP_INI_ENTRY("opcache.jit_max_root_traces" , "1024", PHP_INI_SYSTEM, OnUpdateLong, max_root_traces, zend_jit_globals, jit_globals)
296296
STD_PHP_INI_ENTRY("opcache.jit_max_side_traces" , "128", PHP_INI_SYSTEM, OnUpdateLong, max_side_traces, zend_jit_globals, jit_globals)
297-
STD_PHP_INI_ENTRY("opcache.jit_max_exit_counters" , "8192", PHP_INI_SYSTEM, OnUpdateLong, max_exit_counters, zend_jit_globals, jit_globals)
297+
STD_PHP_INI_ENTRY("opcache.jit_max_exit_counters" , "8192", PHP_INI_SYSTEM, OnUpdateLong, max_exit_counters, zend_jit_globals, jit_globals)
298298
STD_PHP_INI_ENTRY("opcache.jit_hot_loop" , "64", PHP_INI_SYSTEM, OnUpdateCounter, hot_loop, zend_jit_globals, jit_globals)
299299
STD_PHP_INI_ENTRY("opcache.jit_hot_func" , "127", PHP_INI_SYSTEM, OnUpdateCounter, hot_func, zend_jit_globals, jit_globals)
300300
STD_PHP_INI_ENTRY("opcache.jit_hot_return" , "8", PHP_INI_SYSTEM, OnUpdateCounter, hot_return, zend_jit_globals, jit_globals)

0 commit comments

Comments
 (0)