Changeset 26688 in webkit for trunk/JavaScriptCore/wtf/HashTable.h
- Timestamp:
- Oct 16, 2007, 4:25:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashTable.h
r25365 r26688 26 26 #include "FastMalloc.h" 27 27 #include "HashTraits.h" 28 #include < assert.h>28 #include <wtf/Assertions.h> 29 29 30 30 namespace WTF { … … 147 147 { 148 148 checkValidity(); 149 assert(m_position != m_endPosition);149 ASSERT(m_position != m_endPosition); 150 150 ++m_position; 151 151 skipEmptyBuckets(); … … 171 171 { 172 172 #if CHECK_HASHTABLE_ITERATORS 173 assert(m_table);173 ASSERT(m_table); 174 174 #endif 175 175 } … … 179 179 void checkValidity(const const_iterator& other) const 180 180 { 181 assert(m_table);182 assert(other.m_table);183 assert(m_table == other.m_table);181 ASSERT(m_table); 182 ASSERT(other.m_table); 183 ASSERT(m_table == other.m_table); 184 184 } 185 185 #else … … 385 385 inline typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::FullLookupType HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::lookup(const T& key) 386 386 { 387 assert(m_table);387 ASSERT(m_table); 388 388 389 389 unsigned h = HashTranslator::hash(key); … … 461 461 inline void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::reinsert(ValueType& entry) 462 462 { 463 assert(m_table);464 assert(!lookup(Extractor::extract(entry)).second);465 assert(!isDeletedBucket(*(lookup(Extractor::extract(entry)).first)));463 ASSERT(m_table); 464 ASSERT(!lookup(Extractor::extract(entry)).second); 465 ASSERT(!isDeletedBucket(*(lookup(Extractor::extract(entry)).first))); 466 466 #if DUMP_HASHTABLE_STATS 467 467 ++HashTableStats::numReinserts; … … 676 676 { 677 677 checkTableConsistencyExceptSize(); 678 assert(!shouldExpand());679 assert(!shouldShrink());678 ASSERT(!shouldExpand()); 679 ASSERT(!shouldShrink()); 680 680 } 681 681 … … 699 699 700 700 const_iterator it = find(Extractor::extract(*entry)); 701 assert(entry == it.m_position);701 ASSERT(entry == it.m_position); 702 702 ++count; 703 703 } 704 704 705 assert(count == m_keyCount);706 assert(deletedCount == m_deletedCount);707 assert(m_tableSize >= m_minTableSize);708 assert(m_tableSizeMask);709 assert(m_tableSize == m_tableSizeMask + 1);705 ASSERT(count == m_keyCount); 706 ASSERT(deletedCount == m_deletedCount); 707 ASSERT(m_tableSize >= m_minTableSize); 708 ASSERT(m_tableSizeMask); 709 ASSERT(m_tableSize == m_tableSizeMask + 1); 710 710 } 711 711 … … 738 738 it->m_next = 0; 739 739 } else { 740 assert(table->m_iterators != it);740 ASSERT(table->m_iterators != it); 741 741 it->m_next = table->m_iterators; 742 742 table->m_iterators = it; 743 743 if (it->m_next) { 744 assert(!it->m_next->m_previous);744 ASSERT(!it->m_next->m_previous); 745 745 it->m_next->m_previous = it; 746 746 } … … 756 756 // Delete iterator from doubly-linked list of iterators. 757 757 if (!it->m_table) { 758 assert(!it->m_next);759 assert(!it->m_previous);758 ASSERT(!it->m_next); 759 ASSERT(!it->m_previous); 760 760 } else { 761 761 if (it->m_next) { 762 assert(it->m_next->m_previous == it);762 ASSERT(it->m_next->m_previous == it); 763 763 it->m_next->m_previous = it->m_previous; 764 764 } 765 765 if (it->m_previous) { 766 assert(it->m_table->m_iterators != it);767 assert(it->m_previous->m_next == it);766 ASSERT(it->m_table->m_iterators != it); 767 ASSERT(it->m_previous->m_next == it); 768 768 it->m_previous->m_next = it->m_next; 769 769 } else { 770 assert(it->m_table->m_iterators == it);770 ASSERT(it->m_table->m_iterators == it); 771 771 it->m_table->m_iterators = it->m_next; 772 772 }
Note:
See TracChangeset
for help on using the changeset viewer.