forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 3
[Opcache] Add Opcache\Jit attribute example #7
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
Open
beberlei
wants to merge
18
commits into
attributes_v2_rfc
Choose a base branch
from
AttributesOpcacheJit
base: attributes_v2_rfc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kooldev
reviewed
Apr 13, 2020
This was referenced Apr 14, 2020
Closed
Co-authored-by: Martin Schröder <[email protected]>
Implement Changes Requested in PR Review
Implement Opcache File Backend
AST Export / External Linkage
5b3b03f
to
8c1b63c
Compare
8c1b63c
to
d3d7fce
Compare
beberlei
commented
May 2, 2020
@@ -3294,12 +3320,6 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) | |||
return zend_jit_setup_hot_trace_counters(op_array); | |||
} else if (zend_jit_trigger == ZEND_JIT_ON_SCRIPT_LOAD) { | |||
return zend_real_jit_func(op_array, script, NULL); | |||
} else if (zend_jit_trigger == ZEND_JIT_ON_DOC_COMMENT) { |
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.
Having a Jit attribute on the op_array should take precedence over all the other triggers. If you configure the ON_ATTRIBUTE trigger, then it only jits on attributes.
Instead of @jit in the docblock you can now use the <<Opcache\Jit>> attribute. In addition this attribute allows you to disable the JIT for a specific function as well with <<Opcache\Jit(false)>>. Another behavior change is that the Opcache\Jit attribute has precedence over any other trigger as well. This means you can allow to force JIT in profiling triggers or disable JIT for a function regardless of trigger.
d3d7fce
to
cca009a
Compare
3bf85a2
to
4cc905c
Compare
20aceb5
to
8697ccf
Compare
beberlei
pushed a commit
that referenced
this pull request
Jun 19, 2021
The following opcodes would be generated: ... BB1: 0003 JMP BB3 BB2: 0004 INIT_FCALL 1 96 string("chr") 0005 #10.T3 [long] = SR #3.CV0($int) [long] #7.CV2($i) ... 0006 #11.T4 [long] RANGE[0..127] = BW_AND #10.T3 [long] ... 0007 #12.T3 [long] RANGE[128..255] = BW_OR #11.T4 [long] ... 0008 SEND_VAL #12.T3 [long] RANGE[128..255] 1 0009 #13.V3 [ref, rc1, rcn, any] = DO_ICALL 0010 ASSIGN_OP (CONCAT) #6.CV1($out) [rc1, rcn, string] 0011 ADD #7.CV2($i)... int(7) #7.CV2($i) ... -> #15.CV2($i) ... BB3: 0012 #8.T4 [long] = SR #3.CV0($int) #7.CV2($i) [long, double] 0013 #9.T3 [bool] RANGE[0..1] = IS_SMALLER int(128) #8.T4 0014 JMPNZ #9.T3 [bool] RANGE[0..1] BB2 ... Main changes are: 1. SR opcode covers new path in function zend_jit_long_math_helper(). 2. BW_AND and BW_OR opcodes are supported. See macro LONG_OP. 3. Function zend_jit_concat_helper() is added to support ASSIGN_OP opcode. Speficically, CONCAT and FAST_CONCAT is supported for statements "$out .= ...". 4. New path is covered in function zend_jit_cmp_long_long() by IS_SMALLER opcode. 5. New path is covered in macros ZVAL_PTR_DTOR and ZVAL_DTOR_FUNC when leaving.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
To:
In addition allows disabling the JIT for a function regardless of the selected JIT trigger:
Also changes the precedence of an attribute to be always higher than any other trigger definition, which means with
<<Jit(false)>>
you can prevent jitting even for the "on script load" or "on first execute" trigger and with<<Jit(true)>>
you can always force jitting a function or method on profiling trigger modes.