-
Notifications
You must be signed in to change notification settings - Fork 7.9k
JIT refactoring to allow run-time changes of JIT options #5580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ptimization_level, debug flags, etc)
#define ZEND_JIT_TRACE_HOT_SIDE_COUNT 8 /* number of exits before taking side trace */ | ||
#define ZEND_JIT_TRACE_HOT_RETURN_COUNT 8 /* number of returns before taking continuation trace */ | ||
|
||
#define ZEND_JIT_TRACE_MAX_ROOT_FAILURES 16 /* number of attemts to record/compile a root trace */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attemts
-> attempts
From a cursory look, this looks reasonable to me. The distinction between disable/off is not completely intuitive (that is, it's not really obvious which of them means "permanently disabled" and which "temporarily disabled"), but I don't have a good alternative suggestion. There's a test failure in sapi/phpdbg/tests/exceptions_003.phpt, possibly due to whitespace difference. |
|| zend_string_equals_literal_ci(jit, "on") | ||
|| zend_string_equals_literal_ci(jit, "yes") | ||
|| zend_string_equals_literal_ci(jit, "true")) { | ||
JIT_G(enabled) = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use zend_ini_parse_bool here instead?
|
||
if (ZSTR_LEN(jit) == 0 | ||
|| zend_string_equals_literal_ci(jit, "disable") | ||
|| zend_string_equals_literal_ci(jit, "disabled")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s better to stick to one valid value here, like “disable”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. This is not a problem. I expect mistakes, but we may improve the warning message
we could introduce some APIs to toggle the JIT setting in runtime instead of encourage people to use ini_set.
|
yeah, like this http://luajit.org/ext_jit.html |
Merged as 0695048 |
This PR provides ability to change opcache.jit and opcache.jit_debug at run-time, to use different JIT triggers, optimization options and flags.
For now opcache.jit is kept as a numeric ABCD value with encoded flags, trigger and optimization level. In additional, it's possible to use 3 special value.
disable - may be used in php.ini to completely disable JIT
off - turn JIT off (it is possible to start PHP with jit=off and then enable it at run-time)
on - turn JIT on (with default options)
This PR makes a preparation for other improvement in JIT configuration options, like replacing numeric ABCD value, providing default value for opcache.jit_buffer_size, etc. See #5510