Changeset 53899 in webkit for trunk/JavaScriptCore/wtf/HashTable.h
- Timestamp:
- Jan 26, 2010, 9:57:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashTable.h
r53151 r53899 31 31 32 32 #define DUMP_HASHTABLE_STATS 0 33 // Enables internal WTF consistency checks that are invoked automatically. Non-WTF callers can call checkTableConsistency() even if internal checks are disabled. 33 34 #define CHECK_HASHTABLE_CONSISTENCY 0 34 35 … … 341 342 template<typename T, typename HashTranslator> ValueType* lookup(const T&); 342 343 343 #if CHECK_HASHTABLE_CONSISTENCY344 #if !ASSERT_DISABLED 344 345 void checkTableConsistency() const; 345 346 #else 346 347 static void checkTableConsistency() { } 348 #endif 349 #if CHECK_HASHTABLE_CONSISTENCY 350 void internalCheckTableConsistency() const { checkTableConsistency(); } 351 void internalCheckTableConsistencyExceptSize() const { checkTableConsistencyExceptSize(); } 352 #else 353 static void internalCheckTableConsistencyExceptSize() { } 354 static void internalCheckTableConsistency() { } 347 355 #endif 348 356 … … 384 392 const_iterator makeKnownGoodConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); } 385 393 386 #if CHECK_HASHTABLE_CONSISTENCY394 #if !ASSERT_DISABLED 387 395 void checkTableConsistencyExceptSize() const; 388 396 #else 389 static void checkTableConsistencyExceptSize() { }397 static void checkTableConsistencyExceptSize() const { } 390 398 #endif 391 399 … … 625 633 expand(); 626 634 627 checkTableConsistency();635 internalCheckTableConsistency(); 628 636 629 637 ASSERT(m_table); … … 694 702 } 695 703 696 checkTableConsistency();704 internalCheckTableConsistency(); 697 705 698 706 return std::make_pair(makeKnownGoodIterator(entry), true); … … 710 718 expand(); 711 719 712 checkTableConsistency();720 internalCheckTableConsistency(); 713 721 714 722 FullLookupType lookupResult = fullLookupForWriting<T, HashTranslator>(key); … … 739 747 } 740 748 741 checkTableConsistency();749 internalCheckTableConsistency(); 742 750 743 751 return std::make_pair(makeKnownGoodIterator(entry), true); … … 806 814 { 807 815 invalidateIterators(); 808 checkTableConsistency();816 internalCheckTableConsistency(); 809 817 remove(pos); 810 818 } … … 824 832 shrink(); 825 833 826 checkTableConsistency();834 internalCheckTableConsistency(); 827 835 } 828 836 … … 893 901 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::rehash(int newTableSize) 894 902 { 895 checkTableConsistencyExceptSize();903 internalCheckTableConsistencyExceptSize(); 896 904 897 905 int oldTableSize = m_tableSize; … … 915 923 deallocateTable(oldTable, oldTableSize); 916 924 917 checkTableConsistency();925 internalCheckTableConsistency(); 918 926 } 919 927 … … 982 990 } 983 991 984 #if CHECK_HASHTABLE_CONSISTENCY992 #if !ASSERT_DISABLED 985 993 986 994 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> … … 988 996 { 989 997 checkTableConsistencyExceptSize(); 990 ASSERT(! shouldExpand());998 ASSERT(!m_table || !shouldExpand()); 991 999 ASSERT(!shouldShrink()); 992 1000 } … … 1013 1021 ASSERT(entry == it.m_position); 1014 1022 ++count; 1023 1024 KeyTraits::checkValueConsistency(it->first); 1015 1025 } 1016 1026 … … 1022 1032 } 1023 1033 1024 #endif // CHECK_HASHTABLE_CONSISTENCY1034 #endif // ASSERT_DISABLED 1025 1035 1026 1036 #if CHECK_HASHTABLE_ITERATORS
Note:
See TracChangeset
for help on using the changeset viewer.