Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ee2220df20809809d2d94d2f96a9ef26eff49615
      
https://github.com/WebKit/WebKit/commit/ee2220df20809809d2d94d2f96a9ef26eff49615
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-12 (Tue, 12 May 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/test_font_feature_values_parsing-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-audioparam-iterable.https-expected.txt
    M LayoutTests/inspector/debugger/breakpoint-scope-expected.txt
    M LayoutTests/inspector/model/scope-chain-node-expected.txt
    M 
LayoutTests/platform/glib/accessibility/content-editable-as-textarea-expected.txt
    M 
LayoutTests/platform/gtk/accessibility/native-text-control-attributed-string-expected.txt
    M Source/JavaScriptCore/create_hash_table
    M Source/JavaScriptCore/runtime/ImportMap.cpp
    M Source/JavaScriptCore/tools/JSDollarVM.cpp
    M Source/JavaScriptCore/yarr/hasher.py
    M Source/WTF/WTF.xcodeproj/project.pbxproj
    M Source/WTF/wtf/CMakeLists.txt
    M Source/WTF/wtf/OrderedHashMap.h
    M Source/WTF/wtf/OrderedHashSet.h
    M Source/WTF/wtf/text/ASCIIFastPath.h
    A Source/WTF/wtf/text/RapidHash.h
    M Source/WTF/wtf/text/StringHasher.h
    M Source/WTF/wtf/text/StringHasherInlines.h
    M Source/WTF/wtf/text/WYHash.h
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/Modules/webaudio/AudioParamMap.h
    M Source/WebCore/WebCoreMacros.cmake
    M Source/WebCore/bindings/scripts/Hasher.pm
    M Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSShadowRealmGlobalScope.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSWorkerGlobalScope.cpp
    M Source/WebCore/css/CSSCounterStyleRegistry.cpp
    M Source/WebCore/css/CSSCounterStyleRegistry.h
    M Source/WebCore/platform/graphics/FontFeatureValues.h
    M Source/WebCore/platform/graphics/TextMeasurementCache.h
    M Source/WebCore/style/PropertyCascade.h
    M Tools/TestWebKitAPI/CMakeLists.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WTF/OrderedHashMap.cpp
    M Tools/TestWebKitAPI/Tests/WTF/OrderedHashSet.cpp
    A Tools/TestWebKitAPI/Tests/WTF/RapidHash.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
    M Tools/TestWebKitAPI/Tests/WTF/WYHash.cpp

  Log Message:
  -----------
  [WTF] Use RapidHash
https://bugs.webkit.org/show_bug.cgi?id=314453
rdar://176605872

Reviewed by Yijia Huang.

This patch replaces WYHash with RapidHash, this is successor of hash
algorithm introduced by the same group of developers.

1. When replacing hash algorithm, we found many test failures because
   they are relying on HashTable's ordering wrongly. Some internal dump
   tests are just rebaselined. But some tests are failing because they
   are not maintaining the ordering while the spec says it should maintain.
   We replaced these HashSet / HashMap with OrderedHashSet /
   OrderedHashMap and as a result, we can see various tests' progression
   too.
2. Hashing mechanism is inspired from V8's change.
2.1. For Latin-1 8-bit characters, we just run rapidhash onto the data directly.
2.2. For Latin-1 16-bit characters, we narrow each character (16-bit) to
     8-bit, and processing it in the same way to 2.1.
2.3. For UTF-16 characters, we just run rapidhash onto the data directly.
3. This change revealed an existing bug that Hasher.pm dependency is not
   properly set up, as a result, this change didn't start the IDL code
   regeneration. This patch fixes it.

So, before hashing, we scan whether the span is containing
non-Latin-1 character. This scan will be reused in the future to make
AtomString 8-bit when possible.

Tests: Tools/TestWebKitAPI/CMakeLists.txt
       Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
       Tools/TestWebKitAPI/Tests/WTF/RapidHash.cpp
       Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp
       Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
       Tools/TestWebKitAPI/Tests/WTF/WYHash.cpp

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/test_font_feature_values_parsing-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-audioparam-iterable.https-expected.txt:
* LayoutTests/inspector/debugger/breakpoint-scope-expected.txt:
* LayoutTests/inspector/model/scope-chain-node-expected.txt:
* 
LayoutTests/platform/glib/accessibility/content-editable-as-textarea-expected.txt:
* 
LayoutTests/platform/gtk/accessibility/native-text-control-attributed-string-expected.txt:
* Source/JavaScriptCore/create_hash_table:
* Source/JavaScriptCore/runtime/ImportMap.cpp:
(JSC::ImportMap::resolve):
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
* Source/JavaScriptCore/yarr/hasher.py:
(stringHash):
(rapidhash):
(rapidhash.rapid_mul128):
(rapidhash.rapid_mix):
(rapidhash.read64):
(rapidhash.read32):
(rapidhash.readSmall):
(createHashTable):
(wyhash): Deleted.
(wyhash.add64): Deleted.
(wyhash.multi64): Deleted.
(wyhash.wymum): Deleted.
(wyhash.wymix): Deleted.
(wyhash.convert32BitTo64Bit): Deleted.
(wyhash.convert16BitTo32Bit): Deleted.
(wyhash.c2i): Deleted.
(wyhash.wyr8): Deleted.
(wyhash.wyr4): Deleted.
(wyhash.wyr2): Deleted.
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/CMakeLists.txt:
* Source/WTF/wtf/OrderedHashMap.h:
(WTF::equalIgnoringOrder):
* Source/WTF/wtf/OrderedHashSet.h:
(WTF::equalIgnoringOrder):
* Source/WTF/wtf/text/ASCIIFastPath.h:
(WTF::charactersAreAllLatin1):
* Source/WTF/wtf/text/RapidHash.h: Added.
(WTF::RapidHash::computeHashAndMaskTop8Bits):
(WTF::RapidHash::rapidMul128):
(WTF::RapidHash::rapidMix):
(WTF::RapidHash::rapidhashImpl):
(WTF::RapidHash::rapidhash):
(WTF::RapidHash::rapidhashOneBytePerChar):
(WTF::RapidHash::rapidhashRawBytes):
* Source/WTF/wtf/text/StringHasher.h:
* Source/WTF/wtf/text/StringHasherInlines.h:
(WTF::StringHasher::computeHashAndMaskTop8Bits):
(WTF::StringHasher::computeLiteralHashAndMaskTop8Bits):
* Source/WTF/wtf/text/WYHash.h:
(): Deleted.
(WTF::WYHash::computeHashAndMaskTop8Bits): Deleted.
(WTF::WYHash::wyrot): Deleted.
(WTF::WYHash::wymum): Deleted.
(WTF::WYHash::wymix): Deleted.
(WTF::WYHash::bigEndianToLittleEndian8): Deleted.
(WTF::WYHash::bigEndianToLittleEndian4): Deleted.
(WTF::WYHash::bigEndianToLittleEndian2): Deleted.
(WTF::WYHash::Reader16Bit::hasDefaultConverter): Deleted.
(WTF::WYHash::Reader16Bit::convert): Deleted.
(WTF::WYHash::Reader16Bit::wyr3): Deleted.
(WTF::WYHash::Reader16Bit::wyr4WithConvert): Deleted.
(WTF::WYHash::Reader16Bit::wyr4): Deleted.
(WTF::WYHash::Reader16Bit::wyr8WithConvert): Deleted.
(WTF::WYHash::Reader16Bit::wyr8): Deleted.
(WTF::WYHash::Reader8Bit::hasDefaultConverter): Deleted.
(WTF::WYHash::Reader8Bit::convert): Deleted.
(WTF::WYHash::Reader8Bit::wyr3): Deleted.
(WTF::WYHash::Reader8Bit::wyr4WithConvert): Deleted.
(WTF::WYHash::Reader8Bit::wyr4): Deleted.
(WTF::WYHash::Reader8Bit::wyr8WithConvert): Deleted.
(WTF::WYHash::Reader8Bit::wyr8): Deleted.
(WTF::WYHash::initSeed): Deleted.
(WTF::WYHash::consume24Characters): Deleted.
(WTF::WYHash::handleEndCase): Deleted.
(WTF::WYHash::handleGreaterThan8CharactersCase): Deleted.
(WTF::WYHash::hash): Deleted.
(WTF::WYHash::computeHashImpl): Deleted.
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Modules/webaudio/AudioParamMap.h:
* Source/WebCore/WebCoreMacros.cmake:
* Source/WebCore/bindings/scripts/Hasher.pm:
* Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindowDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp:
(WebCore::JSDedicatedWorkerGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp:
(WebCore::JSPaintWorkletGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp:
(WebCore::JSServiceWorkerGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSShadowRealmGlobalScope.cpp:
(WebCore::JSShadowRealmGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp:
(WebCore::JSSharedWorkerGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectDOMConstructor::prototypeForStructure):
* 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesDOMConstructor::prototypeForStructure):
* 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsDOMConstructor::prototypeForStructure):
* Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjDOMConstructor::construct):
* Source/WebCore/bindings/scripts/test/JS/JSWorkerGlobalScope.cpp:
(WebCore::JSWorkerGlobalScopeDOMConstructor::prototypeForStructure):
* Source/WebCore/css/CSSCounterStyleRegistry.cpp:
(WebCore::CSSCounterStyleRegistry::resolveExtendsReference):
* Source/WebCore/css/CSSCounterStyleRegistry.h:
* Source/WebCore/platform/graphics/FontFeatureValues.h:
(WebCore::FontFeatureValues::operator== const):
* Source/WebCore/platform/graphics/TextMeasurementCache.h:
(WebCore::TextMeasurementCache::SmallStringKey::SmallStringKey):
* Source/WebCore/style/PropertyCascade.h:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/OrderedHashMap.cpp:
(TestWebKitAPI::TEST(WTF_OrderedHashMap, EmptyMap)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, BasicAddAndFind)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Set)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Ensure)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Contains)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Get)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, GetOptional)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, InsertionOrderPreserved)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, InsertionOrderPreservedAfterDeletion)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, SetDoesNotChangeOrder)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, RemoveByKey)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, RemoveByIterator)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Take)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, TakeOptional)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, TakeFirst)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Clear)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, Swap)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, CopyConstruction)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, MoveConstruction)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, CopyAssignment)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, MoveAssignment)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, KeysIteration)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, ValuesIteration)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, RehashPreservesOrder)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, DeleteAndReinsert)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, ManyDeletesAndInserts)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, StringKeys)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, InitializerList)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, ReserveCapacity)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, ConstIteration)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, FindReturnsCorrectIterator)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, IteratorComparison)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, 
CompactInPlacePreservesOrderAndCapacity)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, CompactInPlaceOnLargerTable)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, CompactInPlaceWithStringValues)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, RemoveIfAcrossShrinkThreshold)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, MoveOnlyValue)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, MoveOnlyValueRehash)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, HashTranslatorFindContainsGet)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, EqualIgnoringOrder)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, EqualIgnoringOrderDifferentSize)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, EqualIgnoringOrderDifferentValues)):
(TestWebKitAPI::TEST(WTF_OrderedHashMap, EqualIgnoringOrderEmpty)):
* Tools/TestWebKitAPI/Tests/WTF/OrderedHashSet.cpp:
(TestWebKitAPI::TEST(WTF_OrderedHashSet, EmptySet)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, BasicAddAndContains)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, InsertionOrderPreserved)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, InsertionOrderPreservedAfterDeletion)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, Remove)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, RemoveByIterator)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, Take)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, TakeAny)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, Clear)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, Swap)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, CopyConstruction)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, MoveConstruction)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, CopyAssignment)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, MoveAssignment)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, RehashPreservesOrder)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, DeleteAndReinsert)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, ManyDeletesAndInserts)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, StringValues)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, InitializerList)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, AddAll)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, Find)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, ReserveCapacity)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, StressTest)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, 
CompactInPlacePreservesOrderAndCapacity)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, CompactInPlaceOnLargerTable)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, CompactInPlaceWithStrings)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, CompactInPlaceRepeatedCycles)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, RemoveIfAcrossShrinkThreshold)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, MoveOnlyValue)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, MoveOnlyValueRehash)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, HashTranslatorFindContains)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, EqualIgnoringOrder)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, EqualIgnoringOrderDifferentSize)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, EqualIgnoringOrderDifferentElements)):
(TestWebKitAPI::TEST(WTF_OrderedHashSet, EqualIgnoringOrderEmpty)):
* Tools/TestWebKitAPI/Tests/WTF/RapidHash.cpp: Added.
(TestWebKitAPI::TEST(WTF, RapidHasher)):
(TestWebKitAPI::TEST(WTF, RapidHasher_LongStringInvariant)):
(TestWebKitAPI::TEST(WTF, RapidHasher_ConstexprMatchesRuntime)):
(TestWebKitAPI::TEST(WTF, RapidHasher_NonLatin1ConstexprMatchesRuntime)):
(TestWebKitAPI::TEST(WTF, RapidHasher_ASCIICaseInsensitive_8Bit_16Bit_Match)):
(TestWebKitAPI::TEST(WTF, RapidHasher_ASCIICaseInsensitive_SizeCoverage)):
(TestWebKitAPI::TEST(WTF, RapidHasher_SameContentDifferentWidthSameHash)):
(TestWebKitAPI::TEST(WTF, RapidHasher_BuildTimeHashersMatchRuntime)):
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersAreAllLatin1)):
* Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp:
(TestWebKitAPI::TEST(WTF, StringHasher_SuperFastHash_VS_RapidHash)):
(TestWebKitAPI::TEST(WTF, StringHasher_SuperFastHash_VS_WYHash)): Deleted.
* Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::doStaticStringImplTests):
* Tools/TestWebKitAPI/Tests/WTF/WYHash.cpp:
(TestWebKitAPI::TEST(WTF, WYHasher)): Deleted.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to