Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DocumentSharedObjectPool prevents sharing of ElementData in case of h…
…ash collision https://bugs.webkit.org/show_bug.cgi?id=254114 Reviewed by Darin Adler. Use a HashSet of RefPtr<ShareableElementData> for the cache, with proper traits and hashing so that it does what we expect. This means we can let the HashSet implementation deal with hash collision and we can still share ElementData in the event of such collision. The previous code was using a HashMap whose key was the hash and thus couldn't deal with hash collision and would just not share in this case. This is performance neutral on Speedometer on both iPhone and Mac. * Source/WebCore/dom/DocumentSharedObjectPool.cpp: (WebCore::DocumentSharedObjectPool::ShareableElementDataHash::hash): (WebCore::DocumentSharedObjectPool::ShareableElementDataHash::equal): (WebCore::AttributeSpanTranslator::hash): (WebCore::AttributeSpanTranslator::equal): (WebCore::AttributeSpanTranslator::translate): (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes): (WebCore::hasSameAttributes): Deleted. * Source/WebCore/dom/DocumentSharedObjectPool.h: Canonical link: https://commits.webkit.org/261893@main
- Loading branch information