Conversation
Before: ```asm mov %r15,%r14 lea 0x50(%r14),%rdi ; &CV0($o) cmpb $0x8,0x58(%r14) ; Check IS_OBJECT jne not_an_object ; ... mov (%rdi),%rax ; Z_OBJ_P($o) lea -0x77280f9(%rip),%rcx ; ce to compare against cmp 0x10(%rax),%rcx ; Z_OBJ_P($o)->ce == ce je wrong_ce ... ``` After: ```asm mov %r15,%r14 lea 0x50(%r14),%rdi ; &CV0($o) mov (%rdi),%rax ; Z_OBJ_P($o) (known to be an object) lea -0x77280f9(%rip),%rcx ; ce to compare against cmp 0x10(%rax),%rcx ; Z_OBJ_P($o)->ce == ce je wrong_ce ... ``` This also helps with an `?Foo` type check: it can skip the IS_OBJECT and IS_NULL check. This also simplifies `zend_jit_verify_arg_type`: the `(type == IS_UNKNOWN || type == IS_OBJECT)` check becomes always-true.
AWS x86_64 (c6id.metal)
Laravel 12.11.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)
Symfony 2.8.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)
Wordpress 6.9 main page - 50 iterations, 20 warmups, 20 requests (sec)
bench.php - 50 iterations, 20 warmups, 2 requests (sec)
|
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
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.
Follow-up for #24052
Before:
After:
This also helps with an
?Footype check: it can skip the IS_OBJECT and IS_NULL check.This also simplifies
zend_jit_verify_arg_type: the(type == IS_UNKNOWN || type == IS_OBJECT)check becomes always-true.