forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Reduce the minimum size for packed arrays from 8 to 2 #5
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
Closed
Conversation
This file contains hidden or 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
This seems like it causes a noticeable drop in memory usage. (12% in one application. I haven't tried others, and expect it to vary) E.g. for phan self-analysis,
|
ff32c24
to
1b866d8
Compare
@nikic - Do you have any thoughts on this?
|
69053a5
to
ae85ede
Compare
There are probably ways this could be optimized. For now, I'm aiming to see if this will work correctly.
(no change) Fix formatting
This is optional but helps avoid unnecessary reallocations.
bbeb1d6
to
96c469a
Compare
TysonAndre
pushed a commit
that referenced
this pull request
Apr 25, 2021
When encountering the following SSA graph: BB1: #2.T1 [string] = COALESCE #1.CV0($str) [null, string] BB2 BB2: #5.T1 [string] = QM_ASSIGN string("") BB3: #7.X1 [string] = Phi(#2.X1 [string], #5.X1 [string]) FREE #7.T1 [string] We would currently determine that #7, #5 are dead, and eliminate the FREE and QM_ASSIGN. However, we cannot eliminate #2, as COALESCE is also responsible for control flow. Fix this my marking all non-CV phis as live to start with. This can be relaxed to check the kind of the source instruction, but I couldn't immediately come up with a case where it would be useful.
TysonAndre
pushed a commit
that referenced
this pull request
May 31, 2021
Part of generated opcodes for $foo are: ... BB1: 0002 INIT_FCALL 1 96 string("foo") 0003 #5.V1 [rcn, object (instanceof A)] = FETCH_THIS 0004 SEND_REF #5.V1 [rcn, object (instanceof A)] 1 0005 DO_UCALL Updates in functions zend_jit_fetch_this() and zend_jit_load_this() are made to support FETCH_THIS opcode. One new path is covered in function zend_jit_send_ref() by SEND_REF opcode.
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.
There are probably ways this could be optimized (e.g. use a limit of 1 or 0 instead, better places to compute minimums).
For now, I'm aiming to see if this will work correctly.
sapi/phpdbg/tests/watch_006.phpt fails after recent changes to allow sizes that aren't powers of 2.