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