[WTF] Add standard containers with FastAllocator specialization
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2018 12:34:08 +0000 (12:34 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2018 12:34:08 +0000 (12:34 +0000)
commit47efb9381bc17ed058ce3d29fa04dae426d66500
tree5a2b875b6ca661a32bead28ee9538b1b7aa294b8
parentc9ba1d6dc03bb78050d2fe53f0d25c896775c868
[WTF] Add standard containers with FastAllocator specialization
https://bugs.webkit.org/show_bug.cgi?id=183789

Reviewed by Darin Adler.

Source/JavaScriptCore:

* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::testDoubleLiteralComparison):
(JSC::B3::testFloatEqualOrUnorderedFoldingNaN):
* dfg/DFGGraph.h:
* dfg/DFGIntegerCheckCombiningPhase.cpp:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::switchStringSlow):
* runtime/FunctionHasExecutedCache.h:
* runtime/TypeLocationCache.h:

Source/WebCore:

* Modules/indexeddb/IDBKeyData.h:
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/webauthn/cbor/CBORValue.h:
It did not use FastAllocator for its container.

* page/WheelEventTestTrigger.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:
* rendering/OrderIterator.h:

Source/WTF:

Sometimes we want standard containers due to various reasons.
For example, WTF::HashMap lacks the ability to hold all the
integer keys since it uses 0 for empty value and -1 for deleted
value. However, using std::containers use std::allocator without
specialization.

This patch introduces WTF::{StdMap, StdSet, StdList, StdUnorderedMap, StdUnorderedSet}.
They are standard containers with FastAllocator specialization.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/StdList.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/air/testair.cpp
Source/JavaScriptCore/b3/testb3.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp
Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/runtime/FunctionHasExecutedCache.h
Source/JavaScriptCore/runtime/TypeLocationCache.h
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/StdList.h [new file with mode: 0644]
Source/WTF/wtf/StdMap.h [new file with mode: 0644]
Source/WTF/wtf/StdSet.h [new file with mode: 0644]
Source/WTF/wtf/StdUnorderedMap.h [new file with mode: 0644]
Source/WTF/wtf/StdUnorderedSet.h [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyData.h
Source/WebCore/Modules/mediasource/SampleMap.h
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/webauthn/cbor/CBORValue.h
Source/WebCore/page/WheelEventTestTrigger.h
Source/WebCore/platform/audio/PlatformMediaSessionManager.h
Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp
Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp
Source/WebCore/rendering/OrderIterator.h