Title: [272621] trunk/Source/WTF
Revision
272621
Author
[email protected]
Date
2021-02-09 16:34:26 -0800 (Tue, 09 Feb 2021)

Log Message

REGRESSION(r269017): Speedometer2 1% regression
https://bugs.webkit.org/show_bug.cgi?id=221640

Reviewed by Mark Lam.

Reverting r269017, r269478, and r272095 because of Speedometer2 ~1% regression.

* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::addUniqueForInitialization):
(WTF::KeyTraits>::add):
* wtf/HashTraits.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::addFreeSpace):
* wtf/MetaAllocator.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (272620 => 272621)


--- trunk/Source/WTF/ChangeLog	2021-02-10 00:22:01 UTC (rev 272620)
+++ trunk/Source/WTF/ChangeLog	2021-02-10 00:34:26 UTC (rev 272621)
@@ -1,3 +1,23 @@
+2021-02-09  Yusuke Suzuki  <[email protected]>
+
+        REGRESSION(r269017): Speedometer2 1% regression
+        https://bugs.webkit.org/show_bug.cgi?id=221640
+
+        Reviewed by Mark Lam.
+
+        Reverting r269017, r269478, and r272095 because of Speedometer2 ~1% regression.
+
+        * wtf/HashTable.h:
+        (WTF::KeyTraits>::inlineLookup):
+        (WTF::KeyTraits>::lookupForWriting):
+        (WTF::KeyTraits>::fullLookupForWriting):
+        (WTF::KeyTraits>::addUniqueForInitialization):
+        (WTF::KeyTraits>::add):
+        * wtf/HashTraits.h:
+        * wtf/MetaAllocator.cpp:
+        (WTF::MetaAllocator::addFreeSpace):
+        * wtf/MetaAllocator.h:
+
 2021-02-09  Eric Carlson  <[email protected]>
 
         [macOS] Add internal preference to control how AVOutputContext is allocated

Modified: trunk/Source/WTF/wtf/HashTable.h (272620 => 272621)


--- trunk/Source/WTF/wtf/HashTable.h	2021-02-10 00:22:01 UTC (rev 272620)
+++ trunk/Source/WTF/wtf/HashTable.h	2021-02-10 00:34:26 UTC (rev 272621)
@@ -59,8 +59,6 @@
 #define CHECK_HASHTABLE_USE_AFTER_DESTRUCTION 1
 #endif
 
-#define HASH_TABLE_RELEASE_ASSERT(condition) if (UNLIKELY(!(condition))) CRASH();
-
 #if DUMP_HASHTABLE_STATS
 
     struct HashTableStats {
@@ -677,7 +675,6 @@
         unsigned sizeMask = tableSizeMask();
         unsigned h = HashTranslator::hash(key);
         unsigned i = h & sizeMask;
-        unsigned initialIndex = i;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -717,8 +714,6 @@
             if (k == 0)
                 k = 1 | doubleHash(h);
             i = (i + k) & sizeMask;
-            if constexpr (KeyTraits::assertNotFull)
-                HASH_TABLE_RELEASE_ASSERT(i != initialIndex);
         }
     }
 
@@ -734,7 +729,6 @@
         unsigned sizeMask = tableSizeMask();
         unsigned h = HashTranslator::hash(key);
         unsigned i = h & sizeMask;
-        unsigned initialIndex = i;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -781,8 +775,6 @@
             if (k == 0)
                 k = 1 | doubleHash(h);
             i = (i + k) & sizeMask;
-            if constexpr (KeyTraits::assertNotFull)
-                HASH_TABLE_RELEASE_ASSERT(i != initialIndex);
         }
     }
 
@@ -798,7 +790,6 @@
         unsigned sizeMask = tableSizeMask();
         unsigned h = HashTranslator::hash(key);
         unsigned i = h & sizeMask;
-        unsigned initialIndex = i;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -845,8 +836,6 @@
             if (k == 0)
                 k = 1 | doubleHash(h);
             i = (i + k) & sizeMask;
-            if constexpr (KeyTraits::assertNotFull)
-                HASH_TABLE_RELEASE_ASSERT(i != initialIndex);
         }
     }
 
@@ -867,7 +856,6 @@
         unsigned sizeMask = tableSizeMask();
         unsigned h = HashTranslator::hash(key);
         unsigned i = h & sizeMask;
-        unsigned initialIndex = i;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -897,8 +885,6 @@
             if (k == 0)
                 k = 1 | doubleHash(h);
             i = (i + k) & sizeMask;
-            if constexpr (KeyTraits::assertNotFull)
-                HASH_TABLE_RELEASE_ASSERT(i != initialIndex);
         }
 
         HashTranslator::translate(*entry, std::forward<T>(key), std::forward<Extra>(extra));
@@ -951,7 +937,6 @@
         unsigned sizeMask = tableSizeMask();
         unsigned h = HashTranslator::hash(key);
         unsigned i = h & sizeMask;
-        unsigned initialIndex = i;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -998,8 +983,6 @@
             if (k == 0)
                 k = 1 | doubleHash(h);
             i = (i + k) & sizeMask;
-            if constexpr (KeyTraits::assertNotFull)
-                HASH_TABLE_RELEASE_ASSERT(i != initialIndex);
         }
 
         if (deletedEntry) {
@@ -1658,8 +1641,6 @@
         return a.m_impl != b.m_impl;
     }
 
-#undef HASH_TABLE_RELEASE_ASSERT
-
 } // namespace WTF
 
 #include <wtf/HashIterators.h>

Modified: trunk/Source/WTF/wtf/HashTraits.h (272620 => 272621)


--- trunk/Source/WTF/wtf/HashTraits.h	2021-02-10 00:22:01 UTC (rev 272620)
+++ trunk/Source/WTF/wtf/HashTraits.h	2021-02-10 00:34:26 UTC (rev 272621)
@@ -51,9 +51,6 @@
     // The starting table size. Can be overridden when we know beforehand that
     // a hash table will have at least N entries.
     static constexpr unsigned minimumTableSize = 8;
-
-    // Whenever traversing the hash table, assert it is not full
-    static constexpr bool assertNotFull = false;
 };
 
 // Default integer traits disallow both 0 and -1 as keys (max value instead of -1 for unsigned).
@@ -383,11 +380,6 @@
     static bool isDeletedValue(const Vector<T, inlineCapacity>& value) { return value.isHashTableDeletedValue(); }
 };
 
-template<typename Traits>
-struct HardenedHashTraits : public Traits {
-    static constexpr bool assertNotFull = true;
-};
-
 // Useful for classes that want complete control over what is empty and what is deleted,
 // and how to construct both.
 template<typename T>

Modified: trunk/Source/WTF/wtf/MetaAllocator.cpp (272620 => 272621)


--- trunk/Source/WTF/wtf/MetaAllocator.cpp	2021-02-10 00:22:01 UTC (rev 272620)
+++ trunk/Source/WTF/wtf/MetaAllocator.cpp	2021-02-10 00:34:26 UTC (rev 272621)
@@ -307,8 +307,8 @@
 {
     FreeSpacePtr end = start + sizeInBytes;
 
-    auto leftNeighbor = m_freeSpaceEndAddressMap.find(start);
-    auto rightNeighbor = m_freeSpaceStartAddressMap.find(end);
+    HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator leftNeighbor = m_freeSpaceEndAddressMap.find(start);
+    HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator rightNeighbor = m_freeSpaceStartAddressMap.find(end);
 
     if (leftNeighbor != m_freeSpaceEndAddressMap.end()) {
         // We have something we can coalesce with on the left. Remove it from the tree, and

Modified: trunk/Source/WTF/wtf/MetaAllocator.h (272620 => 272621)


--- trunk/Source/WTF/wtf/MetaAllocator.h	2021-02-10 00:22:01 UTC (rev 272620)
+++ trunk/Source/WTF/wtf/MetaAllocator.h	2021-02-10 00:34:26 UTC (rev 272621)
@@ -193,8 +193,8 @@
     unsigned m_logPageSize;
     
     Tree m_freeSpaceSizeMap;
-    HashMap<FreeSpacePtr, FreeSpaceNode*, DefaultHash<FreeSpacePtr>, HardenedHashTraits<HashTraits<FreeSpacePtr>>> m_freeSpaceStartAddressMap;
-    HashMap<FreeSpacePtr, FreeSpaceNode*, DefaultHash<FreeSpacePtr>, HardenedHashTraits<HashTraits<FreeSpacePtr>>> m_freeSpaceEndAddressMap;
+    HashMap<FreeSpacePtr, FreeSpaceNode*> m_freeSpaceStartAddressMap;
+    HashMap<FreeSpacePtr, FreeSpaceNode*> m_freeSpaceEndAddressMap;
     HashMap<uintptr_t, size_t> m_pageOccupancyMap;
     
     size_t m_bytesAllocated;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to