Title: [184985] trunk/Source/WTF
Revision
184985
Author
[email protected]
Date
2015-05-29 08:20:21 -0700 (Fri, 29 May 2015)

Log Message

Unreviewed, rolling out r184949.
https://bugs.webkit.org/show_bug.cgi?id=145458

Ends up generating worse code for HashTable move constructors
(Requested by zdobersek on #webkit).

Reverted changeset:

"Clean up HashTable constructors"
https://bugs.webkit.org/show_bug.cgi?id=145369
http://trac.webkit.org/changeset/184949

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (184984 => 184985)


--- trunk/Source/WTF/ChangeLog	2015-05-29 08:10:00 UTC (rev 184984)
+++ trunk/Source/WTF/ChangeLog	2015-05-29 15:20:21 UTC (rev 184985)
@@ -1,3 +1,17 @@
+2015-05-29  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r184949.
+        https://bugs.webkit.org/show_bug.cgi?id=145458
+
+        Ends up generating worse code for HashTable move constructors
+        (Requested by zdobersek on #webkit).
+
+        Reverted changeset:
+
+        "Clean up HashTable constructors"
+        https://bugs.webkit.org/show_bug.cgi?id=145369
+        http://trac.webkit.org/changeset/184949
+
 2015-05-28  Gyuyoung Kim  <[email protected]>
 
         Purge PassRefPtr in StringConcatenate.h

Modified: trunk/Source/WTF/wtf/HashTable.h (184984 => 184985)


--- trunk/Source/WTF/wtf/HashTable.h	2015-05-29 08:10:00 UTC (rev 184984)
+++ trunk/Source/WTF/wtf/HashTable.h	2015-05-29 15:20:21 UTC (rev 184985)
@@ -532,13 +532,13 @@
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     inline HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::HashTable()
-        : m_table(nullptr)
+        : m_table(0)
         , m_tableSize(0)
         , m_tableSizeMask(0)
         , m_keyCount(0)
         , m_deletedCount(0)
 #if CHECK_HASHTABLE_ITERATORS
-        , m_iterators(nullptr)
+        , m_iterators(0)
         , m_mutex(std::make_unique<std::mutex>())
 #endif
 #if DUMP_HASHTABLE_STATS_PER_TABLE
@@ -1155,7 +1155,18 @@
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::HashTable(const HashTable& other)
-        : HashTable()
+        : m_table(0)
+        , m_tableSize(0)
+        , m_tableSizeMask(0)
+        , m_keyCount(0)
+        , m_deletedCount(0)
+#if CHECK_HASHTABLE_ITERATORS
+        , m_iterators(0)
+        , m_mutex(std::make_unique<std::mutex>())
+#endif
+#if DUMP_HASHTABLE_STATS_PER_TABLE
+        , m_stats(std::make_unique<Stats>(*other.m_stats))
+#endif
     {
         // Copy the hash table the dumb way, by adding each element to the new table.
         // It might be more efficient to copy the table slots, but it's not clear that efficiency is needed.
@@ -1195,9 +1206,29 @@
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     inline HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::HashTable(HashTable&& other)
-        : HashTable()
+#if CHECK_HASHTABLE_ITERATORS
+        : m_iterators(nullptr)
+        , m_mutex(std::make_unique<std::mutex>())
+#endif
     {
-        swap(other);
+        other.invalidateIterators();
+
+        m_table = other.m_table;
+        m_tableSize = other.m_tableSize;
+        m_tableSizeMask = other.m_tableSizeMask;
+        m_keyCount = other.m_keyCount;
+        m_deletedCount = other.m_deletedCount;
+
+        other.m_table = nullptr;
+        other.m_tableSize = 0;
+        other.m_tableSizeMask = 0;
+        other.m_keyCount = 0;
+        other.m_deletedCount = 0;
+
+#if DUMP_HASHTABLE_STATS_PER_TABLE
+        m_stats = WTF::move(other.m_stats);
+        other.m_stats = nullptr;
+#endif
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to