Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 791a760

Browse files
[WTF] Remove the unnecessary inner class DefaultHash<T>::Hash
https://bugs.webkit.org/show_bug.cgi?id=214389 Reviewed by Darin Adler. Source/JavaScriptCore: * assembler/MacroAssemblerCodeRef.h: * b3/B3CheckSpecial.h: * b3/B3Kind.h: * b3/B3ValueKey.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.h: * b3/air/AirTmp.h: * bytecode/BytecodeIndex.h: * bytecode/CallVariant.h: * bytecode/CodeOrigin.h: * bytecode/DFGExitProfile.h: * bytecode/LazyOperandValueProfile.h: * bytecode/ObjectPropertyCondition.h: * bytecode/PropertyCondition.h: * dfg/DFGAbstractHeap.h: * dfg/DFGArgumentsEliminationPhase.cpp: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCompilationKey.h: * dfg/DFGDesiredGlobalProperty.h: * dfg/DFGHeapLocation.h: * dfg/DFGLivenessAnalysisPhase.cpp: * dfg/DFGMinifiedID.h: * dfg/DFGNodeFlowProjection.h: * dfg/DFGPromotedHeapLocation.h: * dfg/DFGPropertyTypeKey.h: * dfg/DFGPureValue.h: * ftl/FTLLocation.h: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject): * ftl/FTLSlowPathCallKey.h: * heap/MarkedBlock.h: * heap/VisitRaceKey.h: * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/expected/enum-values.json-result: * inspector/scripts/tests/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: * inspector/scripts/tests/expected/type-declaration-object-type.json-result: * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: * jit/ICStats.h: * jit/JITThunks.h: * jit/Reg.h: * jit/RegisterSet.h: * parser/VariableEnvironment.h: * profiler/ProfilerOrigin.h: * profiler/ProfilerOriginStack.h: * profiler/ProfilerUID.h: * runtime/CachedTypes.cpp: * runtime/ControlFlowProfiler.h: * runtime/NativeFunction.h: * runtime/PrototypeKey.h: * runtime/RegExpKey.h: * runtime/TemplateObjectDescriptor.h: * runtime/TypeProfiler.h: * runtime/VarOffset.h: * runtime/WeakGCMap.h: * wasm/WasmBBQPlan.h: * wasm/WasmCodeBlock.h: * wasm/WasmEntryPlan.h: * wasm/WasmLLIntPlan.h: * wasm/WasmSignature.h: Source/WebCore: * Modules/indexeddb/IDBDatabaseIdentifier.h: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: (WebCore::WHLSL::matchResources): (WebCore::WHLSL::matchVertexAttributes): (WebCore::WHLSL::matchColorAttachments): * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeActions): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::TriggerHash::hash): * contentextensions/ContentExtensionStyleSheet.h: * contentextensions/DFA.cpp: (WebCore::ContentExtensions::printTransitions): * contentextensions/DFABytecodeInterpreter.h: * contentextensions/DFACombiner.cpp: (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode): * contentextensions/DFANode.cpp: (WebCore::ContentExtensions::DFANode::bestFallbackTarget const): * contentextensions/ImmutableNFANodeBuilder.h: * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): * contentextensions/NFANode.h: * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate): * css/makeprop.pl: * css/parser/CSSParserContext.h: * dom/GCReachableRef.h: * dom/MessagePortIdentifier.h: * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): * dom/QualifiedName.h: * history/BackForwardItemIdentifier.h: * html/canvas/WebGLRenderingContextBase.h: * layout/LayoutUnits.h: * loader/AdClickAttribution.h: * loader/ResourceCryptographicDigest.h: (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::hash): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::equal): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash): Deleted. (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal): Deleted. * page/ClientOrigin.h: * page/GlobalWindowIdentifier.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * platform/Cookie.h: * platform/RegistrableDomain.h: * platform/graphics/ColorHash.h: * platform/graphics/FloatSizeHash.h: (WTF::FloatHash<WebCore::FloatSize>::hash): * platform/graphics/FontGenericFamilies.h: * platform/graphics/IntPointHash.h: * platform/graphics/IntRectHash.h: (WTF::IntHash<WebCore::IntRect>::hash): (WTF::IntHash<WebCore::IntRect>::equal): * platform/graphics/IntSizeHash.h: * platform/graphics/WidthCache.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FallbackFontDescriptionKey::computeHash const): * platform/network/HTTPParsers.h: * platform/network/ProtectionSpaceHash.h: * platform/win/COMPtr.h: * platform/win/WindowsKeyNames.h: * rendering/CSSValueKey.h: * rendering/GridBaselineAlignment.h: * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): * rendering/RenderTheme.h: * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules): * svg/SVGElement.h: (WebCore::SVGAttributeHashTranslator::hash): * workers/service/ServiceWorkerClientIdentifier.h: * workers/service/ServiceWorkerRegistrationKey.h: Source/WebCore/PAL: * pal/SessionID.h: Source/WebKit: * NetworkProcess/Downloads/DownloadID.h: * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheKey.h: * Platform/IPC/MessageReceiverMap.h: * Platform/IPC/StringReference.h: * Shared/CallbackID.h: * UIProcess/API/cpp/WKRetainPtr.h: Source/WebKitLegacy/win: * COMPropertyBag.h: Source/WTF: DefaultHash<T> doesn't need to have a inner struct Hash. This can be a problem for forward declarations (Bug 214320 Comment 5). * wtf/BitVector.h: * wtf/Forward.h: * wtf/HashFunctions.h: (WTF::PairHash::hash): (WTF::PairHash::equal): (WTF::TupleHash::hash): (WTF::TupleHash::equal): * wtf/ListHashSet.h: * wtf/LoggingHashMap.h: * wtf/LoggingHashSet.h: * wtf/MetaAllocatorPtr.h: * wtf/ObjectIdentifier.h: * wtf/OptionSetHash.h: (WTF::DefaultHash<OptionSet<T>>::hash): (WTF::DefaultHash<OptionSet<T>>::equal): (WTF::DefaultHash<OptionSet<T>>::Hash::hash): Deleted. (WTF::DefaultHash<OptionSet<T>>::Hash::equal): Deleted. * wtf/Packed.h: * wtf/RetainPtr.h: * wtf/StackShot.h: * wtf/URLHash.h: * wtf/VectorHash.h: (WTF::VectorHash::hash): * wtf/text/AtomString.h: * wtf/text/AtomStringHash.h: * wtf/text/CString.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.h: * wtf/text/SymbolRegistry.h: (WTF::DefaultHash<SymbolRegistryKey>::hash): (WTF::DefaultHash<SymbolRegistryKey>::equal): (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash): Deleted. (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal): Deleted. * wtf/text/WTFString.h: Tools: * TestWebKitAPI/Tests/WTF/DeletedAddressOfOperator.h: (WTF::DefaultHash<DeletedAddressOfOperator>::hash): (WTF::DefaultHash<DeletedAddressOfOperator>::equal): (WTF::DefaultHash<DeletedAddressOfOperator>::Hash::hash): Deleted. (WTF::DefaultHash<DeletedAddressOfOperator>::Hash::equal): Deleted. * TestWebKitAPI/Tests/WTF/HashCountedSet.cpp: (TestWebKitAPI::bucketForKey): * TestWebKitAPI/Tests/WTF/HashMap.cpp: (TestWebKitAPI::bucketForKey): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/HashSet.cpp: (TestWebKitAPI::testInitialCapacity): * TestWebKitAPI/Tests/WTF/MoveOnly.h: (WTF::DefaultHash<MoveOnly>::hash): (WTF::DefaultHash<MoveOnly>::equal): (WTF::DefaultHash<MoveOnly>::Hash::hash): Deleted. (WTF::DefaultHash<MoveOnly>::Hash::equal): Deleted. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@264488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent f08c1ed commit 791a760

File tree

161 files changed

+556
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+556
-497
lines changed

Source/JavaScriptCore/ChangeLog

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,76 @@
1+
2020-07-16 Fujii Hironori <[email protected]>
2+
3+
[WTF] Remove the unnecessary inner class DefaultHash<T>::Hash
4+
https://bugs.webkit.org/show_bug.cgi?id=214389
5+
6+
Reviewed by Darin Adler.
7+
8+
* assembler/MacroAssemblerCodeRef.h:
9+
* b3/B3CheckSpecial.h:
10+
* b3/B3Kind.h:
11+
* b3/B3ValueKey.h:
12+
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
13+
* b3/air/AirArg.h:
14+
* b3/air/AirTmp.h:
15+
* bytecode/BytecodeIndex.h:
16+
* bytecode/CallVariant.h:
17+
* bytecode/CodeOrigin.h:
18+
* bytecode/DFGExitProfile.h:
19+
* bytecode/LazyOperandValueProfile.h:
20+
* bytecode/ObjectPropertyCondition.h:
21+
* bytecode/PropertyCondition.h:
22+
* dfg/DFGAbstractHeap.h:
23+
* dfg/DFGArgumentsEliminationPhase.cpp:
24+
* dfg/DFGByteCodeParser.cpp:
25+
* dfg/DFGCSEPhase.cpp:
26+
* dfg/DFGCompilationKey.h:
27+
* dfg/DFGDesiredGlobalProperty.h:
28+
* dfg/DFGHeapLocation.h:
29+
* dfg/DFGLivenessAnalysisPhase.cpp:
30+
* dfg/DFGMinifiedID.h:
31+
* dfg/DFGNodeFlowProjection.h:
32+
* dfg/DFGPromotedHeapLocation.h:
33+
* dfg/DFGPropertyTypeKey.h:
34+
* dfg/DFGPureValue.h:
35+
* ftl/FTLLocation.h:
36+
* ftl/FTLLowerDFGToB3.cpp:
37+
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread):
38+
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
39+
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
40+
* ftl/FTLSlowPathCallKey.h:
41+
* heap/MarkedBlock.h:
42+
* heap/VisitRaceKey.h:
43+
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
44+
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
45+
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
46+
* inspector/scripts/tests/expected/enum-values.json-result:
47+
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
48+
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
49+
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
50+
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
51+
* jit/ICStats.h:
52+
* jit/JITThunks.h:
53+
* jit/Reg.h:
54+
* jit/RegisterSet.h:
55+
* parser/VariableEnvironment.h:
56+
* profiler/ProfilerOrigin.h:
57+
* profiler/ProfilerOriginStack.h:
58+
* profiler/ProfilerUID.h:
59+
* runtime/CachedTypes.cpp:
60+
* runtime/ControlFlowProfiler.h:
61+
* runtime/NativeFunction.h:
62+
* runtime/PrototypeKey.h:
63+
* runtime/RegExpKey.h:
64+
* runtime/TemplateObjectDescriptor.h:
65+
* runtime/TypeProfiler.h:
66+
* runtime/VarOffset.h:
67+
* runtime/WeakGCMap.h:
68+
* wasm/WasmBBQPlan.h:
69+
* wasm/WasmCodeBlock.h:
70+
* wasm/WasmEntryPlan.h:
71+
* wasm/WasmLLIntPlan.h:
72+
* wasm/WasmSignature.h:
73+
174
2020-07-16 Yusuke Suzuki <[email protected]>
275

376
[JSC] Use unvalidatedGet instead of get to access UnlinkedCodeBlock from CodeBlock destructor

Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,7 @@ inline FunctionPtr<tag>::FunctionPtr(MacroAssemblerCodePtr<tag> ptr)
529529
namespace WTF {
530530

531531
template<typename T> struct DefaultHash;
532-
template<JSC::PtrTag tag> struct DefaultHash<JSC::MacroAssemblerCodePtr<tag>> {
533-
typedef JSC::MacroAssemblerCodePtrHash<tag> Hash;
534-
};
532+
template<JSC::PtrTag tag> struct DefaultHash<JSC::MacroAssemblerCodePtr<tag>> : JSC::MacroAssemblerCodePtrHash<tag> { };
535533

536534
template<typename T> struct HashTraits;
537535
template<JSC::PtrTag tag> struct HashTraits<JSC::MacroAssemblerCodePtr<tag>> : public CustomHashTraits<JSC::MacroAssemblerCodePtr<tag>> { };

Source/JavaScriptCore/b3/B3CheckSpecial.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ struct CheckSpecialKeyHash {
149149
namespace WTF {
150150

151151
template<typename T> struct DefaultHash;
152-
template<> struct DefaultHash<JSC::B3::CheckSpecial::Key> {
153-
typedef JSC::B3::CheckSpecialKeyHash Hash;
154-
};
152+
template<> struct DefaultHash<JSC::B3::CheckSpecial::Key> : JSC::B3::CheckSpecialKeyHash { };
155153

156154
template<typename T> struct HashTraits;
157155
template<> struct HashTraits<JSC::B3::CheckSpecial::Key> : SimpleClassHashTraits<JSC::B3::CheckSpecial::Key> {

Source/JavaScriptCore/b3/B3Kind.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ struct KindHash {
219219
namespace WTF {
220220

221221
template<typename T> struct DefaultHash;
222-
template<> struct DefaultHash<JSC::B3::Kind> {
223-
typedef JSC::B3::KindHash Hash;
224-
};
222+
template<> struct DefaultHash<JSC::B3::Kind> : JSC::B3::KindHash { };
225223

226224
template<typename T> struct HashTraits;
227225
template<> struct HashTraits<JSC::B3::Kind> : public SimpleClassHashTraits<JSC::B3::Kind> {

Source/JavaScriptCore/b3/B3ValueKey.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ struct ValueKeyHash {
186186
namespace WTF {
187187

188188
template<typename T> struct DefaultHash;
189-
template<> struct DefaultHash<JSC::B3::ValueKey> {
190-
typedef JSC::B3::ValueKeyHash Hash;
191-
};
189+
template<> struct DefaultHash<JSC::B3::ValueKey> : JSC::B3::ValueKeyHash { };
192190

193191
template<typename T> struct HashTraits;
194192
template<> struct HashTraits<JSC::B3::ValueKey> : public SimpleClassHashTraits<JSC::B3::ValueKey> {

Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ class AbstractColoringAllocator {
559559
Vector<Vector<IndexType, 0, UnsafeVectorOverflow, 4>, 0, UnsafeVectorOverflow> m_adjacencyList;
560560
Vector<IndexType, 0, UnsafeVectorOverflow> m_degrees;
561561

562-
using IndexTypeSet = HashSet<IndexType, typename DefaultHash<IndexType>::Hash, WTF::UnsignedWithZeroKeyHashTraits<IndexType>>;
562+
using IndexTypeSet = HashSet<IndexType, DefaultHash<IndexType>, WTF::UnsignedWithZeroKeyHashTraits<IndexType>>;
563563

564-
HashMap<IndexType, IndexTypeSet, typename DefaultHash<IndexType>::Hash, WTF::UnsignedWithZeroKeyHashTraits<IndexType>> m_biases;
564+
HashMap<IndexType, IndexTypeSet, DefaultHash<IndexType>, WTF::UnsignedWithZeroKeyHashTraits<IndexType>> m_biases;
565565

566566
// Instead of keeping track of the move instructions, we just keep their operands around and use the index
567567
// in the vector as the "identifier" for the move.

Source/JavaScriptCore/b3/air/AirArg.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,9 +1482,7 @@ JS_EXPORT_PRIVATE void printInternal(PrintStream&, JSC::B3::Air::Arg::Role);
14821482
JS_EXPORT_PRIVATE void printInternal(PrintStream&, JSC::B3::Air::Arg::Signedness);
14831483

14841484
template<typename T> struct DefaultHash;
1485-
template<> struct DefaultHash<JSC::B3::Air::Arg> {
1486-
typedef JSC::B3::Air::ArgHash Hash;
1487-
};
1485+
template<> struct DefaultHash<JSC::B3::Air::Arg> : JSC::B3::Air::ArgHash { };
14881486

14891487
template<typename T> struct HashTraits;
14901488
template<> struct HashTraits<JSC::B3::Air::Arg> : SimpleClassHashTraits<JSC::B3::Air::Arg> {

Source/JavaScriptCore/b3/air/AirTmp.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ struct TmpHash {
330330
namespace WTF {
331331

332332
template<typename T> struct DefaultHash;
333-
template<> struct DefaultHash<JSC::B3::Air::Tmp> {
334-
typedef JSC::B3::Air::TmpHash Hash;
335-
};
333+
template<> struct DefaultHash<JSC::B3::Air::Tmp> : JSC::B3::Air::TmpHash { };
336334

337335
template<typename T> struct HashTraits;
338336
template<> struct HashTraits<JSC::B3::Air::Tmp> : SimpleClassHashTraits<JSC::B3::Air::Tmp> { };

Source/JavaScriptCore/bytecode/BytecodeIndex.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ struct BytecodeIndexHash {
113113
namespace WTF {
114114

115115
template<typename T> struct DefaultHash;
116-
template<> struct DefaultHash<JSC::BytecodeIndex> {
117-
typedef JSC::BytecodeIndexHash Hash;
118-
};
116+
template<> struct DefaultHash<JSC::BytecodeIndex> : JSC::BytecodeIndexHash { };
119117

120118
template<typename T> struct HashTraits;
121119
template<> struct HashTraits<JSC::BytecodeIndex> : SimpleClassHashTraits<JSC::BytecodeIndex> {

Source/JavaScriptCore/bytecode/CallVariant.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ CallVariantList despecifiedVariantList(const CallVariantList&);
212212
namespace WTF {
213213

214214
template<typename T> struct DefaultHash;
215-
template<> struct DefaultHash<JSC::CallVariant> {
216-
typedef JSC::CallVariantHash Hash;
217-
};
215+
template<> struct DefaultHash<JSC::CallVariant> : JSC::CallVariantHash { };
218216

219217
template<typename T> struct HashTraits;
220218
template<> struct HashTraits<JSC::CallVariant> : SimpleClassHashTraits<JSC::CallVariant> { };

0 commit comments

Comments
 (0)