Skip to content
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

[WTF] Need specialization for DefaultHash<CompactPtr<StringImpl>> with StringHash #1764

Conversation

Constellation
Copy link
Member

@Constellation Constellation commented Jun 24, 2022

62275c8

[WTF] Need specialization for DefaultHash<CompactPtr<StringImpl>> with StringHash
https://bugs.webkit.org/show_bug.cgi?id=241955

Reviewed by Tim Horton.

AtomStringTable uses CompactPtr only when it is more efficient than PackedPtr, which means, it is non-simulator iOS family.
And we lack the specialization of DefaultHash<CompactPtr<StringImpl>> with StringHash: usually, we can just use PtrHash.
But for StringImpl, we have specialization of this hash function, so we must make DefaultHash StringHash for CompactPtr<StringImpl>
case too. This patch also adds a test including HashMap<CompactPtr<StringImpl>> removal & re-addition to hit deleted cases.

* Source/WTF/wtf/text/StringHash.h:
(WTF::StringHash::hash):
(WTF::StringHash::equal):
(WTF::ASCIICaseInsensitiveHash::hash):
(WTF::ASCIICaseInsensitiveHash::equal):
* Source/WTF/wtf/text/StringImpl.h:
* Tools/TestWebKitAPI/Tests/WTF/CompactPtr.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/251824@main

@Constellation Constellation self-assigned this Jun 24, 2022
@Constellation Constellation added JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. WebKit Nightly Build labels Jun 24, 2022
@Constellation Constellation force-pushed the eng/WTF-Need-specialization-for-DefaultHashCompactPtrStringImpl-with-StringHash branch from 4b819b6 to fd5f3de Compare June 24, 2022 06:20
@Constellation Constellation added the merge-queue Applied to send a pull request to merge-queue label Jun 24, 2022
…h StringHash

https://bugs.webkit.org/show_bug.cgi?id=241955

Reviewed by Tim Horton.

AtomStringTable uses CompactPtr only when it is more efficient than PackedPtr, which means, it is non-simulator iOS family.
And we lack the specialization of DefaultHash<CompactPtr<StringImpl>> with StringHash: usually, we can just use PtrHash.
But for StringImpl, we have specialization of this hash function, so we must make DefaultHash StringHash for CompactPtr<StringImpl>
case too. This patch also adds a test including HashMap<CompactPtr<StringImpl>> removal & re-addition to hit deleted cases.

* Source/WTF/wtf/text/StringHash.h:
(WTF::StringHash::hash):
(WTF::StringHash::equal):
(WTF::ASCIICaseInsensitiveHash::hash):
(WTF::ASCIICaseInsensitiveHash::equal):
* Source/WTF/wtf/text/StringImpl.h:
* Tools/TestWebKitAPI/Tests/WTF/CompactPtr.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/251824@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/WTF-Need-specialization-for-DefaultHashCompactPtrStringImpl-with-StringHash branch from fd5f3de to 62275c8 Compare June 24, 2022 08:37
@webkit-early-warning-system webkit-early-warning-system merged commit 62275c8 into WebKit:main Jun 24, 2022
@webkit-commit-queue
Copy link
Collaborator

Committed 251824@main (62275c8): https://commits.webkit.org/251824@main

Reviewed commits have been landed. Closing PR #1764 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 24, 2022
@Constellation Constellation deleted the eng/WTF-Need-specialization-for-DefaultHashCompactPtrStringImpl-with-StringHash branch June 24, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.
Projects
None yet
4 participants