[libpas] atomic-load gets CSE-ed while it can be changed concurrently#62315
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Apr 9, 2026
Conversation
Collaborator
|
EWS run on previous version of this PR (hash f0ae737) Details
|
f0ae737 to
5b85920
Compare
Collaborator
|
EWS run on previous version of this PR (hash 5b85920) Details
|
5b85920 to
c4ffd8b
Compare
Collaborator
|
EWS run on previous version of this PR (hash c4ffd8b) Details
|
c4ffd8b to
d3b16ac
Compare
Collaborator
|
EWS run on current version of this PR (hash d3b16ac) Details
|
Achierius
approved these changes
Apr 9, 2026
https://bugs.webkit.org/show_bug.cgi?id=311776 rdar://174363026 Reviewed by Marcus Plutowski. This patch fixes two issues. 1. pas_compact_atomic_ptr's null check gets eliminated. Since it is just a normal load and store, compiler can do CSE if no current-thread's modification possibility is found. Given that this atomic load / store is almost always for concurrent access, we should just use atomic relaxed load and store. 2. Debug assertion failure via `pas_bitfit_directory_get_view`'s bound check in `pas_bitfit_directory_get_first_free_view` call. When we call `pas_bitfit_directory_find_first_empty`, which reloads the new max_size. so `found_empty_index.index` can be larger than the previously loaded max_size. This leads to hitting a debug assertion failure in pas_bitfit_directory_get_view since we get a size from a old `directory`, and this obtained index and loading directory does not have any dependencies. We put a dependency between then to get the fresh up-to-date max_size for assertion. * Source/bmalloc/libpas/src/libpas/pas_bitfit_directory.c: (pas_bitfit_directory_get_first_free_view): * Source/bmalloc/libpas/src/libpas/pas_compact_atomic_ptr.h: * Source/bmalloc/libpas/src/libpas/pas_compact_tagged_atomic_ptr.h: * Source/bmalloc/libpas/src/libpas/pas_utils.h: Canonical link: https://commits.webkit.org/310860@main
d3b16ac to
75529ed
Compare
Collaborator
|
Committed 310860@main (75529ed): https://commits.webkit.org/310860@main Reviewed commits have been landed. Closing PR #62315 and removing active labels. |
Member
|
This broke PlayStation, as EWS indicated -- @Constellation could you fix? |
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.
🛠 ios-apple
75529ed
d3b16ac
🛠 win🧪 win-tests