Skip to content

Commit 53ef244

Browse files
committed
Add opcache.jit=tracing|function values, make on/yes/true synonym for tracing.
1 parent 1213907 commit 53ef244

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
@@ -3750,16 +3750,24 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
37503750
JIT_G(on) = 0;
37513751
return SUCCESS;
37523752
} else if (zend_string_equals_literal_ci(jit, "0")
3753-
|| zend_string_equals_literal_ci(jit, "off")
3754-
|| zend_string_equals_literal_ci(jit, "no")
3755-
|| zend_string_equals_literal_ci(jit, "false")) {
3753+
|| zend_string_equals_literal_ci(jit, "off")
3754+
|| zend_string_equals_literal_ci(jit, "no")
3755+
|| zend_string_equals_literal_ci(jit, "false")) {
37563756
JIT_G(enabled) = 1;
37573757
JIT_G(on) = 0;
37583758
return SUCCESS;
37593759
} else if (zend_string_equals_literal_ci(jit, "1")
3760-
|| zend_string_equals_literal_ci(jit, "on")
3761-
|| zend_string_equals_literal_ci(jit, "yes")
3762-
|| zend_string_equals_literal_ci(jit, "true")) {
3760+
|| zend_string_equals_literal_ci(jit, "on")
3761+
|| zend_string_equals_literal_ci(jit, "yes")
3762+
|| zend_string_equals_literal_ci(jit, "true")
3763+
|| zend_string_equals_literal_ci(jit, "tracing")) {
3764+
JIT_G(enabled) = 1;
3765+
JIT_G(on) = 1;
3766+
JIT_G(opt_level) = ZEND_JIT_LEVEL_OPT_FUNCS;
3767+
JIT_G(trigger) = ZEND_JIT_ON_HOT_TRACE;
3768+
JIT_G(opt_flags) = ZEND_JIT_REG_ALLOC_GLOBAL | ZEND_JIT_CPU_AVX;
3769+
return SUCCESS;
3770+
} else if (zend_string_equals_literal_ci(jit, "function")) {
37633771
JIT_G(enabled) = 1;
37643772
JIT_G(on) = 1;
37653773
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)