-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Remove distinct tail bucket in JSMap / JSSet
https://bugs.webkit.org/show_bug.cgi?id=260117 rdar://113791351 Reviewed by Michael Saboff. JSMap / JSSet's m_tail can just point to the same entry to the head initially. And we can keep this head's next() as nullptr. So, 1. Iterating entries is just doing it until we hit nullptr. 2. Adding a entry is chaining a new entry after m_tail and replace m_tail with this new entry. 3. Removing a entry is unchaining from this linked-list. But we must correctly update m_tail when removing a entry which is pointed by m_tail too. Then, we do not need to have distinct tail entry for JSMap and JSSet. * Source/JavaScriptCore/runtime/HashMapImplInlines.h: (JSC::HashMapImpl<HashMapBucketType>::removeNormalized): (JSC::HashMapImpl<HashMapBucketType>::clear): (JSC::HashMapImpl<HashMapBucketType>::setUpHeadAndTail): (JSC::HashMapImpl<HashMapBucketType>::addNormalizedInternal): (JSC::HashMapImpl<HashMapBucketType>::rehash): (JSC::HashMapImpl<HashMapBucketType>::checkConsistency const): Canonical link: https://commits.webkit.org/266869@main
- Loading branch information
1 parent
6b4f259
commit 76449f2
Showing
2 changed files
with
75 additions
and
62 deletions.
There are no files selected for viewing
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
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