Title: [219383] trunk/Source/WebCore
Revision
219383
Author
[email protected]
Date
2017-07-11 22:42:33 -0700 (Tue, 11 Jul 2017)

Log Message

Use FastAllocator in STL containers
https://bugs.webkit.org/show_bug.cgi?id=174366

Rubber stamped by Sam Weinig.

This patch uses FastAllocator for STL containers including std::set and std::map.
STL can take a template parameter to be used as allocator for containers.
We prepare FastAllocator, which uses fastMalloc for allocation.
This allows us to use bmalloc (if supported) for STL containers which offers
functionalities that is not supported in WTF containers.

* Modules/indexeddb/IDBKeyData.h:
* Modules/indexeddb/server/IndexValueEntry.cpp:
(WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
(WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
(WebCore::IDBServer::IndexValueEntry::reverseFind):
* Modules/indexeddb/server/IndexValueEntry.h:
* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
(WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
(WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
(WebCore::IDBServer::MemoryObjectStore::addRecord):
(WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
* Modules/indexeddb/server/MemoryObjectStore.h:
(WebCore::IDBServer::MemoryObjectStore::orderedKeys):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
(WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:
* Modules/mediasource/SampleMap.h:
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::deferTestsForReason):
(WebCore::dumpState):
* page/WheelEventTestTrigger.h:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::enumToStringMap):
* rendering/OrderIterator.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219382 => 219383)


--- trunk/Source/WebCore/ChangeLog	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/ChangeLog	2017-07-12 05:42:33 UTC (rev 219383)
@@ -1,3 +1,53 @@
+2017-07-11  Yusuke Suzuki  <[email protected]>
+
+        Use FastAllocator in STL containers
+        https://bugs.webkit.org/show_bug.cgi?id=174366
+
+        Rubber stamped by Sam Weinig.
+
+        This patch uses FastAllocator for STL containers including std::set and std::map.
+        STL can take a template parameter to be used as allocator for containers.
+        We prepare FastAllocator, which uses fastMalloc for allocation.
+        This allows us to use bmalloc (if supported) for STL containers which offers
+        functionalities that is not supported in WTF containers.
+
+        * Modules/indexeddb/IDBKeyData.h:
+        * Modules/indexeddb/server/IndexValueEntry.cpp:
+        (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
+        (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
+        (WebCore::IDBServer::IndexValueEntry::reverseFind):
+        * Modules/indexeddb/server/IndexValueEntry.h:
+        * Modules/indexeddb/server/IndexValueStore.cpp:
+        (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
+        (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
+        (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
+        * Modules/indexeddb/server/IndexValueStore.h:
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
+        (WebCore::IDBServer::MemoryObjectStore::addRecord):
+        (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+        (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
+        * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
+        (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
+        * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
+        * Modules/mediasource/SampleMap.h:
+        * page/WheelEventTestTrigger.cpp:
+        (WebCore::WheelEventTestTrigger::deferTestsForReason):
+        (WebCore::dumpState):
+        * page/WheelEventTestTrigger.h:
+        * platform/graphics/cv/VideoTextureCopierCV.cpp:
+        (WebCore::enumToStringMap):
+        * rendering/OrderIterator.h:
+
 2017-07-11  Per Arne Vollan  <[email protected]>
 
         [Win] Build error when building WebKit.dll from WebKit.proj project file.

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -28,6 +28,7 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBKey.h"
+#include <set>
 #include <wtf/Variant.h>
 #include <wtf/text/StringHash.h>
 
@@ -299,6 +300,8 @@
     return true;
 }
 
+using IDBKeyDataSet = std::set<IDBKeyData, std::less<IDBKeyData>, FastAllocator<IDBKeyData>>;
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -39,7 +39,7 @@
     if (m_unique)
         m_key = nullptr;
     else
-        m_orderedKeys = new std::set<IDBKeyData>;
+        m_orderedKeys = new IDBKeyDataSet;
 }
 
 IndexValueEntry::~IndexValueEntry()
@@ -101,13 +101,13 @@
     ASSERT(m_entry->m_key);
 }
 
-IndexValueEntry::Iterator::Iterator(IndexValueEntry& entry, std::set<IDBKeyData>::iterator iterator)
+IndexValueEntry::Iterator::Iterator(IndexValueEntry& entry, IDBKeyDataSet::iterator iterator)
     : m_entry(&entry)
     , m_forwardIterator(iterator)
 {
 }
 
-IndexValueEntry::Iterator::Iterator(IndexValueEntry& entry, std::set<IDBKeyData>::reverse_iterator iterator)
+IndexValueEntry::Iterator::Iterator(IndexValueEntry& entry, IDBKeyDataSet::reverse_iterator iterator)
     : m_entry(&entry)
     , m_forward(false)
     , m_reverseIterator(iterator)
@@ -218,7 +218,7 @@
     }
 
     ASSERT(m_orderedKeys);
-    auto iterator = std::set<IDBKeyData>::reverse_iterator(m_orderedKeys->upper_bound(key));
+    auto iterator = IDBKeyDataSet::reverse_iterator(m_orderedKeys->upper_bound(key));
     if (iterator == m_orderedKeys->rend())
         return { };
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -28,7 +28,6 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBKeyData.h"
-#include <set>
 
 namespace WebCore {
 
@@ -59,8 +58,8 @@
         }
 
         Iterator(IndexValueEntry&);
-        Iterator(IndexValueEntry&, std::set<IDBKeyData>::iterator);
-        Iterator(IndexValueEntry&, std::set<IDBKeyData>::reverse_iterator);
+        Iterator(IndexValueEntry&, IDBKeyDataSet::iterator);
+        Iterator(IndexValueEntry&, IDBKeyDataSet::reverse_iterator);
 
         bool isValid() const;
         void invalidate();
@@ -73,8 +72,8 @@
     private:
         IndexValueEntry* m_entry { nullptr };
         bool m_forward { true };
-        std::set<IDBKeyData>::iterator m_forwardIterator;
-        std::set<IDBKeyData>::reverse_iterator m_reverseIterator;
+        IDBKeyDataSet::iterator m_forwardIterator;
+        IDBKeyDataSet::reverse_iterator m_reverseIterator;
     };
 
     Iterator begin();
@@ -89,7 +88,7 @@
 
 private:
     union {
-        std::set<IDBKeyData>* m_orderedKeys;
+        IDBKeyDataSet* m_orderedKeys;
         IDBKeyData* m_key;
     };
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.cpp (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -142,7 +142,7 @@
     return *iterator;
 }
 
-std::set<IDBKeyData>::iterator IndexValueStore::lowestIteratorInRange(const IDBKeyRangeData& range) const
+IDBKeyDataSet::iterator IndexValueStore::lowestIteratorInRange(const IDBKeyRangeData& range) const
 {
     auto lowestInRange = m_orderedKeys.lower_bound(range.lowerKey);
 
@@ -166,9 +166,9 @@
     return lowestInRange;
 }
 
-std::set<IDBKeyData>::reverse_iterator IndexValueStore::highestReverseIteratorInRange(const IDBKeyRangeData& range) const
+IDBKeyDataSet::reverse_iterator IndexValueStore::highestReverseIteratorInRange(const IDBKeyRangeData& range) const
 {
-    auto highestInRange = std::set<IDBKeyData>::reverse_iterator(m_orderedKeys.upper_bound(range.upperKey));
+    auto highestInRange = IDBKeyDataSet::reverse_iterator(m_orderedKeys.upper_bound(range.upperKey));
 
     if (highestInRange == m_orderedKeys.rend())
         return highestInRange;
@@ -312,7 +312,7 @@
 }
 
 
-IndexValueStore::Iterator::Iterator(IndexValueStore& store, std::set<IDBKeyData>::iterator iterator, IndexValueEntry::Iterator primaryIterator)
+IndexValueStore::Iterator::Iterator(IndexValueStore& store, IDBKeyDataSet::iterator iterator, IndexValueEntry::Iterator primaryIterator)
     : m_store(&store)
     , m_forwardIterator(iterator)
     , m_primaryKeyIterator(primaryIterator)
@@ -319,7 +319,7 @@
 {
 }
 
-IndexValueStore::Iterator::Iterator(IndexValueStore& store, CursorDuplicity duplicity, std::set<IDBKeyData>::reverse_iterator iterator, IndexValueEntry::Iterator primaryIterator)
+IndexValueStore::Iterator::Iterator(IndexValueStore& store, CursorDuplicity duplicity, IDBKeyDataSet::reverse_iterator iterator, IndexValueEntry::Iterator primaryIterator)
     : m_store(&store)
     , m_forward(false)
     , m_duplicity(duplicity)

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -30,7 +30,6 @@
 #include "IDBCursorInfo.h"
 #include "IDBKeyData.h"
 #include "IndexValueEntry.h"
-#include <set>
 #include <wtf/HashMap.h>
 
 namespace WebCore {
@@ -67,8 +66,8 @@
         {
         }
 
-        Iterator(IndexValueStore&, std::set<IDBKeyData>::iterator, IndexValueEntry::Iterator);
-        Iterator(IndexValueStore&, CursorDuplicity, std::set<IDBKeyData>::reverse_iterator, IndexValueEntry::Iterator);
+        Iterator(IndexValueStore&, IDBKeyDataSet::iterator, IndexValueEntry::Iterator);
+        Iterator(IndexValueStore&, CursorDuplicity, IDBKeyDataSet::reverse_iterator, IndexValueEntry::Iterator);
 
         void invalidate();
         bool isValid();
@@ -84,8 +83,8 @@
         IndexValueStore* m_store { nullptr };
         bool m_forward { true };
         CursorDuplicity m_duplicity { CursorDuplicity::Duplicates };
-        std::set<IDBKeyData>::iterator m_forwardIterator;
-        std::set<IDBKeyData>::reverse_iterator m_reverseIterator;
+        IDBKeyDataSet::iterator m_forwardIterator;
+        IDBKeyDataSet::reverse_iterator m_reverseIterator;
 
         IndexValueEntry::Iterator m_primaryKeyIterator;
     };
@@ -103,11 +102,11 @@
 #endif
 
 private:
-    std::set<IDBKeyData>::iterator lowestIteratorInRange(const IDBKeyRangeData&) const;
-    std::set<IDBKeyData>::reverse_iterator highestReverseIteratorInRange(const IDBKeyRangeData&) const;
+    IDBKeyDataSet::iterator lowestIteratorInRange(const IDBKeyRangeData&) const;
+    IDBKeyDataSet::reverse_iterator highestReverseIteratorInRange(const IDBKeyRangeData&) const;
 
     IndexKeyValueMap m_records;
-    std::set<IDBKeyData> m_orderedKeys;
+    IDBKeyDataSet m_orderedKeys;
     
     bool m_unique;
 };

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -134,7 +134,7 @@
         addResult.iterator->value = WTFMove(objectStore);
 }
 
-void MemoryBackingStoreTransaction::objectStoreCleared(MemoryObjectStore& objectStore, std::unique_ptr<KeyValueMap>&& keyValueMap, std::unique_ptr<std::set<IDBKeyData>>&& orderedKeys)
+void MemoryBackingStoreTransaction::objectStoreCleared(MemoryObjectStore& objectStore, std::unique_ptr<KeyValueMap>&& keyValueMap, std::unique_ptr<IDBKeyDataSet>&& orderedKeys)
 {
     ASSERT(m_objectStores.contains(&objectStore));
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -62,7 +62,7 @@
     
     void recordValueChanged(MemoryObjectStore&, const IDBKeyData&, ThreadSafeDataBuffer*);
     void objectStoreDeleted(Ref<MemoryObjectStore>&&);
-    void objectStoreCleared(MemoryObjectStore&, std::unique_ptr<KeyValueMap>&&, std::unique_ptr<std::set<IDBKeyData>>&&);
+    void objectStoreCleared(MemoryObjectStore&, std::unique_ptr<KeyValueMap>&&, std::unique_ptr<IDBKeyDataSet>&&);
     void objectStoreRenamed(MemoryObjectStore&, const String& oldName);
     void indexRenamed(MemoryIndex&, const String& oldName);
     void indexCleared(MemoryIndex&, std::unique_ptr<IndexValueStore>&&);
@@ -95,7 +95,7 @@
     HashMap<String, RefPtr<MemoryIndex>> m_deletedIndexes;
     HashMap<MemoryObjectStore*, std::unique_ptr<KeyValueMap>> m_originalValues;
     HashMap<MemoryObjectStore*, std::unique_ptr<KeyValueMap>> m_clearedKeyValueMaps;
-    HashMap<MemoryObjectStore*, std::unique_ptr<std::set<IDBKeyData>>> m_clearedOrderedKeys;
+    HashMap<MemoryObjectStore*, std::unique_ptr<IDBKeyDataSet>> m_clearedOrderedKeys;
     HashMap<MemoryObjectStore*, String> m_originalObjectStoreNames;
     HashMap<MemoryIndex*, String> m_originalIndexNames;
     HashMap<MemoryIndex*, std::unique_ptr<IndexValueStore>> m_clearedIndexValueStores;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -191,7 +191,7 @@
         cursor->objectStoreCleared();
 }
 
-void MemoryObjectStore::replaceKeyValueStore(std::unique_ptr<KeyValueMap>&& store, std::unique_ptr<std::set<IDBKeyData>>&& orderedKeys)
+void MemoryObjectStore::replaceKeyValueStore(std::unique_ptr<KeyValueMap>&& store, std::unique_ptr<IDBKeyDataSet>&& orderedKeys)
 {
     ASSERT(m_writeTransaction);
     ASSERT(m_writeTransaction->isAborting());
@@ -263,7 +263,7 @@
     if (!m_keyValueStore) {
         ASSERT(!m_orderedKeys);
         m_keyValueStore = std::make_unique<KeyValueMap>();
-        m_orderedKeys = std::make_unique<std::set<IDBKeyData>>();
+        m_orderedKeys = std::make_unique<IDBKeyDataSet>();
     }
 
     auto mapResult = m_keyValueStore->set(keyData, value.data());
@@ -282,7 +282,7 @@
     return error;
 }
 
-void MemoryObjectStore::updateCursorsForPutRecord(std::set<IDBKeyData>::iterator iterator)
+void MemoryObjectStore::updateCursorsForPutRecord(IDBKeyDataSet::iterator iterator)
 {
     for (auto& cursor : m_cursors.values())
         cursor->keyAdded(iterator);

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -32,7 +32,6 @@
 #include "MemoryIndex.h"
 #include "MemoryObjectStoreCursor.h"
 #include "ThreadSafeDataBuffer.h"
-#include <set>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 
@@ -81,7 +80,7 @@
     void setKeyGeneratorValue(uint64_t value) { m_keyGeneratorValue = value; }
 
     void clear();
-    void replaceKeyValueStore(std::unique_ptr<KeyValueMap>&&, std::unique_ptr<std::set<IDBKeyData>>&&);
+    void replaceKeyValueStore(std::unique_ptr<KeyValueMap>&&, std::unique_ptr<IDBKeyDataSet>&&);
 
     ThreadSafeDataBuffer valueForKey(const IDBKeyData&) const;
     ThreadSafeDataBuffer valueForKeyRange(const IDBKeyRangeData&) const;
@@ -95,7 +94,7 @@
 
     MemoryObjectStoreCursor* maybeOpenCursor(const IDBCursorInfo&);
 
-    std::set<IDBKeyData>* orderedKeys() { return m_orderedKeys.get(); }
+    IDBKeyDataSet* orderedKeys() { return m_orderedKeys.get(); }
 
     MemoryIndex* indexForIdentifier(uint64_t);
 
@@ -107,12 +106,12 @@
 private:
     MemoryObjectStore(const IDBObjectStoreInfo&);
 
-    std::set<IDBKeyData>::iterator lowestIteratorInRange(const IDBKeyRangeData&, bool reverse) const;
+    IDBKeyDataSet::iterator lowestIteratorInRange(const IDBKeyRangeData&, bool reverse) const;
 
     IDBError populateIndexWithExistingRecords(MemoryIndex&);
     IDBError updateIndexesForPutRecord(const IDBKeyData&, const ThreadSafeDataBuffer& value);
     void updateIndexesForDeleteRecord(const IDBKeyData& value);
-    void updateCursorsForPutRecord(std::set<IDBKeyData>::iterator);
+    void updateCursorsForPutRecord(IDBKeyDataSet::iterator);
     void updateCursorsForDeleteRecord(const IDBKeyData&);
 
     RefPtr<MemoryIndex> takeIndexByIdentifier(uint64_t indexIdentifier);
@@ -123,7 +122,7 @@
     uint64_t m_keyGeneratorValue { 1 };
 
     std::unique_ptr<KeyValueMap> m_keyValueStore;
-    std::unique_ptr<std::set<IDBKeyData>> m_orderedKeys;
+    std::unique_ptr<IDBKeyDataSet> m_orderedKeys;
 
     void unregisterIndex(MemoryIndex&);
     HashMap<uint64_t, RefPtr<MemoryIndex>> m_indexesByIdentifier;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -62,7 +62,7 @@
     m_iterator = std::nullopt;
 }
 
-void MemoryObjectStoreCursor::keyAdded(std::set<IDBKeyData>::iterator iterator)
+void MemoryObjectStoreCursor::keyAdded(IDBKeyDataSet::iterator iterator)
 {
     if (m_iterator)
         return;
@@ -71,7 +71,7 @@
         m_iterator = iterator;
 }
 
-void MemoryObjectStoreCursor::setFirstInRemainingRange(std::set<IDBKeyData>& set)
+void MemoryObjectStoreCursor::setFirstInRemainingRange(IDBKeyDataSet& set)
 {
     m_iterator = std::nullopt;
 
@@ -92,7 +92,7 @@
     ASSERT(!m_iterator || *m_iterator != set.end());
 }
 
-void MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange(std::set<IDBKeyData>& set)
+void MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange(IDBKeyDataSet& set)
 {
     if (!set.size()) {
         m_iterator = std::nullopt;
@@ -130,7 +130,7 @@
     m_iterator = lowest;
 }
 
-void MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange(std::set<IDBKeyData>& set)
+void MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange(IDBKeyDataSet& set)
 {
     if (!set.size()) {
         m_iterator = std::nullopt;
@@ -198,7 +198,7 @@
     }
 }
 
-void MemoryObjectStoreCursor::incrementForwardIterator(std::set<IDBKeyData>& set, const IDBKeyData& key, uint32_t count)
+void MemoryObjectStoreCursor::incrementForwardIterator(IDBKeyDataSet& set, const IDBKeyData& key, uint32_t count)
 {
     // We might need to re-grab the current iterator.
     // e.g. If the record it was pointed to had been deleted.
@@ -254,7 +254,7 @@
     }
 }
 
-void MemoryObjectStoreCursor::incrementReverseIterator(std::set<IDBKeyData>& set, const IDBKeyData& key, uint32_t count)
+void MemoryObjectStoreCursor::incrementReverseIterator(IDBKeyDataSet& set, const IDBKeyData& key, uint32_t count)
 {
     // We might need to re-grab the current iterator.
     // e.g. If the record it was pointed to had been deleted.

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -30,7 +30,6 @@
 #include "IDBCursorInfo.h"
 #include "IDBKeyData.h"
 #include "MemoryCursor.h"
-#include <set>
 #include <wtf/Optional.h>
 
 namespace WebCore {
@@ -44,18 +43,18 @@
 
     void objectStoreCleared();
     void keyDeleted(const IDBKeyData&);
-    void keyAdded(std::set<IDBKeyData>::iterator);
+    void keyAdded(IDBKeyDataSet::iterator);
 
 private:
     void currentData(IDBGetResult&) final;
     void iterate(const IDBKeyData&, const IDBKeyData& primaryKey, uint32_t count, IDBGetResult&) final;
 
-    void setFirstInRemainingRange(std::set<IDBKeyData>&);
-    void setForwardIteratorFromRemainingRange(std::set<IDBKeyData>&);
-    void setReverseIteratorFromRemainingRange(std::set<IDBKeyData>&);
+    void setFirstInRemainingRange(IDBKeyDataSet&);
+    void setForwardIteratorFromRemainingRange(IDBKeyDataSet&);
+    void setReverseIteratorFromRemainingRange(IDBKeyDataSet&);
 
-    void incrementForwardIterator(std::set<IDBKeyData>&, const IDBKeyData&, uint32_t count);
-    void incrementReverseIterator(std::set<IDBKeyData>&, const IDBKeyData&, uint32_t count);
+    void incrementForwardIterator(IDBKeyDataSet&, const IDBKeyData&, uint32_t count);
+    void incrementReverseIterator(IDBKeyDataSet&, const IDBKeyData&, uint32_t count);
 
     bool hasValidPosition() const;
 
@@ -63,7 +62,7 @@
 
     IDBKeyRangeData m_remainingRange;
 
-    std::optional<std::set<IDBKeyData>::iterator> m_iterator;
+    std::optional<IDBKeyDataSet::iterator> m_iterator;
 
     IDBKeyData m_currentPositionKey;
 };

Modified: trunk/Source/WebCore/Modules/mediasource/SampleMap.h (219382 => 219383)


--- trunk/Source/WebCore/Modules/mediasource/SampleMap.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/Modules/mediasource/SampleMap.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -39,7 +39,7 @@
 class PresentationOrderSampleMap {
     friend class SampleMap;
 public:
-    typedef std::map<MediaTime, RefPtr<MediaSample>> MapType;
+    using MapType = std::map<MediaTime, RefPtr<MediaSample>, std::less<MediaTime>, FastAllocator<std::pair<const MediaTime, RefPtr<MediaSample>>>>;
     typedef MapType::iterator iterator;
     typedef MapType::const_iterator const_iterator;
     typedef MapType::reverse_iterator reverse_iterator;
@@ -72,7 +72,7 @@
     friend class SampleMap;
 public:
     typedef std::pair<MediaTime, MediaTime> KeyType;
-    typedef std::map<KeyType, RefPtr<MediaSample>> MapType;
+    using MapType = std::map<KeyType, RefPtr<MediaSample>, std::less<KeyType>, FastAllocator<std::pair<const KeyType, RefPtr<MediaSample>>>>;
     typedef MapType::iterator iterator;
     typedef MapType::const_iterator const_iterator;
     typedef MapType::reverse_iterator reverse_iterator;

Modified: trunk/Source/WebCore/page/WheelEventTestTrigger.cpp (219382 => 219383)


--- trunk/Source/WebCore/page/WheelEventTestTrigger.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/page/WheelEventTestTrigger.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -68,7 +68,7 @@
     std::lock_guard<Lock> lock(m_testTriggerMutex);
     auto it = m_deferTestTriggerReasons.find(identifier);
     if (it == m_deferTestTriggerReasons.end())
-        it = m_deferTestTriggerReasons.add(identifier, std::set<DeferTestTriggerReason>()).iterator;
+        it = m_deferTestTriggerReasons.add(identifier, DeferTestTriggerReasonSet()).iterator;
     
     LOG(WheelEventTestTriggers, "      (=) WheelEventTestTrigger::deferTestsForReason: id=%p, reason=%d", identifier, reason);
     it->value.insert(reason);
@@ -89,7 +89,7 @@
 }
 
 #if !LOG_DISABLED
-static void dumpState(WTF::HashMap<WheelEventTestTrigger::ScrollableAreaIdentifier, std::set<WheelEventTestTrigger::DeferTestTriggerReason>> reasons)
+static void dumpState(WTF::HashMap<WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReasonSet> reasons)
 {
     LOG(WheelEventTestTriggers, "   WheelEventTestTrigger::dumpState:");
     for (const auto& scrollRegion : reasons) {

Modified: trunk/Source/WebCore/page/WheelEventTestTrigger.h (219382 => 219383)


--- trunk/Source/WebCore/page/WheelEventTestTrigger.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/page/WheelEventTestTrigger.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -52,6 +52,7 @@
         ScrollingThreadSyncNeeded,
         ContentScrollInProgress
     };
+    using DeferTestTriggerReasonSet = std::set<DeferTestTriggerReason, std::less<DeferTestTriggerReason>, FastAllocator<DeferTestTriggerReason>>;
     typedef const void* ScrollableAreaIdentifier;
     void WEBCORE_EXPORT deferTestsForReason(ScrollableAreaIdentifier, DeferTestTriggerReason);
     void WEBCORE_EXPORT removeTestDeferralForReason(ScrollableAreaIdentifier, DeferTestTriggerReason);
@@ -61,7 +62,7 @@
     WTF::Function<void()> m_testNotificationCallback;
     RunLoop::Timer<WheelEventTestTrigger> m_testTriggerTimer;
     mutable Lock m_testTriggerMutex;
-    WTF::HashMap<ScrollableAreaIdentifier, std::set<DeferTestTriggerReason>> m_deferTestTriggerReasons;
+    WTF::HashMap<ScrollableAreaIdentifier, DeferTestTriggerReasonSet> m_deferTestTriggerReasons;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp (219382 => 219383)


--- trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp	2017-07-12 05:42:33 UTC (rev 219383)
@@ -49,13 +49,13 @@
 }
 
 #if !LOG_DISABLED
-
+using StringMap = std::map<uint32_t, const char*, std::less<uint32_t>, FastAllocator<std::pair<const uint32_t, const char*>>>;
 #define STRINGIFY_PAIR(e) e, #e
-static std::map<uint32_t, const char*>& enumToStringMap()
+static StringMap& enumToStringMap()
 {
-    static NeverDestroyed<std::map<uint32_t, const char*>> map;
+    static NeverDestroyed<StringMap> map;
     if (map.get().empty()) {
-        std::map<uint32_t, const char*> stringMap;
+        StringMap stringMap;
         map.get().emplace(STRINGIFY_PAIR(GL_RGB));
         map.get().emplace(STRINGIFY_PAIR(GL_RGBA));
         map.get().emplace(STRINGIFY_PAIR(GL_LUMINANCE_ALPHA));

Modified: trunk/Source/WebCore/rendering/OrderIterator.h (219382 => 219383)


--- trunk/Source/WebCore/rendering/OrderIterator.h	2017-07-12 04:14:42 UTC (rev 219382)
+++ trunk/Source/WebCore/rendering/OrderIterator.h	2017-07-12 05:42:33 UTC (rev 219383)
@@ -56,7 +56,7 @@
     RenderBox& m_containerBox;
     RenderBox* m_currentChild;
 
-    typedef std::set<int> OrderValues;
+    using OrderValues = std::set<int, std::less<int>, FastAllocator<int>>;
     OrderValues m_orderValues;
     OrderValues::const_iterator m_orderValuesIterator;
     bool m_isReset { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to