Changeset 272621 in webkit
- Timestamp:
- Feb 9, 2021 4:34:26 PM (3 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r272611 r272621 1 2021-02-09 Yusuke Suzuki <ysuzuki@apple.com> 2 3 REGRESSION(r269017): Speedometer2 1% regression 4 https://bugs.webkit.org/show_bug.cgi?id=221640 5 6 Reviewed by Mark Lam. 7 8 Reverting r269017, r269478, and r272095 because of Speedometer2 ~1% regression. 9 10 * wtf/HashTable.h: 11 (WTF::KeyTraits>::inlineLookup): 12 (WTF::KeyTraits>::lookupForWriting): 13 (WTF::KeyTraits>::fullLookupForWriting): 14 (WTF::KeyTraits>::addUniqueForInitialization): 15 (WTF::KeyTraits>::add): 16 * wtf/HashTraits.h: 17 * wtf/MetaAllocator.cpp: 18 (WTF::MetaAllocator::addFreeSpace): 19 * wtf/MetaAllocator.h: 20 1 21 2021-02-09 Eric Carlson <eric.carlson@apple.com> 2 22 -
trunk/Source/WTF/wtf/HashTable.h
r272095 r272621 60 60 #endif 61 61 62 #define HASH_TABLE_RELEASE_ASSERT(condition) if (UNLIKELY(!(condition))) CRASH();63 64 62 #if DUMP_HASHTABLE_STATS 65 63 … … 678 676 unsigned h = HashTranslator::hash(key); 679 677 unsigned i = h & sizeMask; 680 unsigned initialIndex = i;681 678 682 679 #if DUMP_HASHTABLE_STATS … … 718 715 k = 1 | doubleHash(h); 719 716 i = (i + k) & sizeMask; 720 if constexpr (KeyTraits::assertNotFull)721 HASH_TABLE_RELEASE_ASSERT(i != initialIndex);722 717 } 723 718 } … … 735 730 unsigned h = HashTranslator::hash(key); 736 731 unsigned i = h & sizeMask; 737 unsigned initialIndex = i;738 732 739 733 #if DUMP_HASHTABLE_STATS … … 782 776 k = 1 | doubleHash(h); 783 777 i = (i + k) & sizeMask; 784 if constexpr (KeyTraits::assertNotFull)785 HASH_TABLE_RELEASE_ASSERT(i != initialIndex);786 778 } 787 779 } … … 799 791 unsigned h = HashTranslator::hash(key); 800 792 unsigned i = h & sizeMask; 801 unsigned initialIndex = i;802 793 803 794 #if DUMP_HASHTABLE_STATS … … 846 837 k = 1 | doubleHash(h); 847 838 i = (i + k) & sizeMask; 848 if constexpr (KeyTraits::assertNotFull)849 HASH_TABLE_RELEASE_ASSERT(i != initialIndex);850 839 } 851 840 } … … 868 857 unsigned h = HashTranslator::hash(key); 869 858 unsigned i = h & sizeMask; 870 unsigned initialIndex = i;871 859 872 860 #if DUMP_HASHTABLE_STATS … … 898 886 k = 1 | doubleHash(h); 899 887 i = (i + k) & sizeMask; 900 if constexpr (KeyTraits::assertNotFull)901 HASH_TABLE_RELEASE_ASSERT(i != initialIndex);902 888 } 903 889 … … 952 938 unsigned h = HashTranslator::hash(key); 953 939 unsigned i = h & sizeMask; 954 unsigned initialIndex = i;955 940 956 941 #if DUMP_HASHTABLE_STATS … … 999 984 k = 1 | doubleHash(h); 1000 985 i = (i + k) & sizeMask; 1001 if constexpr (KeyTraits::assertNotFull)1002 HASH_TABLE_RELEASE_ASSERT(i != initialIndex);1003 986 } 1004 987 … … 1659 1642 } 1660 1643 1661 #undef HASH_TABLE_RELEASE_ASSERT1662 1663 1644 } // namespace WTF 1664 1645 -
trunk/Source/WTF/wtf/HashTraits.h
r272095 r272621 52 52 // a hash table will have at least N entries. 53 53 static constexpr unsigned minimumTableSize = 8; 54 55 // Whenever traversing the hash table, assert it is not full56 static constexpr bool assertNotFull = false;57 54 }; 58 55 … … 384 381 }; 385 382 386 template<typename Traits>387 struct HardenedHashTraits : public Traits {388 static constexpr bool assertNotFull = true;389 };390 391 383 // Useful for classes that want complete control over what is empty and what is deleted, 392 384 // and how to construct both. -
trunk/Source/WTF/wtf/MetaAllocator.cpp
r272095 r272621 308 308 FreeSpacePtr end = start + sizeInBytes; 309 309 310 autoleftNeighbor = m_freeSpaceEndAddressMap.find(start);311 autorightNeighbor = m_freeSpaceStartAddressMap.find(end);310 HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator leftNeighbor = m_freeSpaceEndAddressMap.find(start); 311 HashMap<FreeSpacePtr, FreeSpaceNode*>::iterator rightNeighbor = m_freeSpaceStartAddressMap.find(end); 312 312 313 313 if (leftNeighbor != m_freeSpaceEndAddressMap.end()) { -
trunk/Source/WTF/wtf/MetaAllocator.h
r272095 r272621 194 194 195 195 Tree m_freeSpaceSizeMap; 196 HashMap<FreeSpacePtr, FreeSpaceNode* , DefaultHash<FreeSpacePtr>, HardenedHashTraits<HashTraits<FreeSpacePtr>>> m_freeSpaceStartAddressMap;197 HashMap<FreeSpacePtr, FreeSpaceNode* , DefaultHash<FreeSpacePtr>, HardenedHashTraits<HashTraits<FreeSpacePtr>>> m_freeSpaceEndAddressMap;196 HashMap<FreeSpacePtr, FreeSpaceNode*> m_freeSpaceStartAddressMap; 197 HashMap<FreeSpacePtr, FreeSpaceNode*> m_freeSpaceEndAddressMap; 198 198 HashMap<uintptr_t, size_t> m_pageOccupancyMap; 199 199
Note: See TracChangeset
for help on using the changeset viewer.