haikuwebkit/Source/WTF/wtf/OptionSetHash.h

69 lines
2.4 KiB
C
Raw Permalink Normal View History

/*
* Copyright (C) 2019 Sony Interactive Entertainment Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <wtf/HashTraits.h>
#include <wtf/OptionSet.h>
namespace WTF {
template<typename T> struct DefaultHash<OptionSet<T>> {
[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. Canonical link: https://commits.webkit.org/227236@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-17 00:33:37 +00:00
static unsigned hash(OptionSet<T> key)
{
return IntHash<typename OptionSet<T>::StorageType>::hash(key.toRaw());
}
[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. Canonical link: https://commits.webkit.org/227236@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-17 00:33:37 +00:00
static bool equal(OptionSet<T> a, OptionSet<T> b)
{
return a == b;
}
[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. Canonical link: https://commits.webkit.org/227236@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-17 00:33:37 +00:00
static constexpr bool safeToCompareToEmptyOrDeleted = true;
};
template<typename T> struct HashTraits<OptionSet<T>> : GenericHashTraits<OptionSet<T>> {
using StorageTraits = UnsignedWithZeroKeyHashTraits<typename OptionSet<T>::StorageType>;
static OptionSet<T> emptyValue()
{
return OptionSet<T>::fromRaw(StorageTraits::emptyValue());
}
static void constructDeletedValue(OptionSet<T>& slot)
{
typename OptionSet<T>::StorageType storage;
StorageTraits::constructDeletedValue(storage);
slot = OptionSet<T>::fromRaw(storage);
}
static bool isDeletedValue(OptionSet<T> value)
{
return StorageTraits::isDeletedValue(value.toRaw());
}
};
} // namespace WTF