Changeset 19302 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 31, 2007, 5:43:13 AM (18 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r19268 r19302 1 2007-01-31 Maciej Stachowiak <[email protected]> 2 3 Reviewed by Mark with help from Lars. 4 5 - added new ListHashSet class, which combines a hashtable and a linked list to provide a set 6 that keeps elements in inserted order 7 8 This is to assist in fixing the following: 9 <rdar://problem/4751164> REGRESSION: Safari places text on incorrect button when returning to a page via back [10541] 10 http://bugs.webkit.org/show_bug.cgi?id=10541 11 12 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 13 * JavaScriptCore.xcodeproj/project.pbxproj: 14 * wtf/HashTable.h: 15 (WTF::HashTable::find): 16 (WTF::HashTable::contains): 17 (WTF::::find): 18 (WTF::::contains): 19 * wtf/ListHashSet.h: Added. 20 (WTF::ListHashSetNode::ListHashSetNode): 21 (WTF::ListHashSetNodeHashFunctions::hash): 22 (WTF::ListHashSetNodeHashFunctions::equal): 23 (WTF::ListHashSetIterator::ListHashSetIterator): 24 (WTF::ListHashSetIterator::get): 25 (WTF::ListHashSetIterator::operator*): 26 (WTF::ListHashSetIterator::operator->): 27 (WTF::ListHashSetIterator::operator++): 28 (WTF::ListHashSetIterator::operator--): 29 (WTF::ListHashSetIterator::operator==): 30 (WTF::ListHashSetIterator::operator!=): 31 (WTF::ListHashSetIterator::operator const_iterator): 32 (WTF::ListHashSetIterator::node): 33 (WTF::ListHashSetConstIterator::ListHashSetConstIterator): 34 (WTF::ListHashSetConstIterator::get): 35 (WTF::ListHashSetConstIterator::operator*): 36 (WTF::ListHashSetConstIterator::operator->): 37 (WTF::ListHashSetConstIterator::operator++): 38 (WTF::ListHashSetConstIterator::operator--): 39 (WTF::ListHashSetConstIterator::operator==): 40 (WTF::ListHashSetConstIterator::operator!=): 41 (WTF::ListHashSetConstIterator::node): 42 (WTF::ListHashSetTranslator::hash): 43 (WTF::ListHashSetTranslator::equal): 44 (WTF::ListHashSetTranslator::translate): 45 (WTF::::ListHashSet): 46 (WTF::::operator): 47 (WTF::::~ListHashSet): 48 (WTF::::size): 49 (WTF::::capacity): 50 (WTF::::isEmpty): 51 (WTF::::begin): 52 (WTF::::end): 53 (WTF::::find): 54 (WTF::::contains): 55 (WTF::::add): 56 (WTF::::remove): 57 (WTF::::clear): 58 (WTF::::unlinkAndDelete): 59 (WTF::::appendNode): 60 (WTF::::deleteAllNodes): 61 (WTF::::makeIterator): 62 (WTF::::makeConstIterator): 63 (WTF::deleteAllValues): 64 1 65 2007-01-30 Darin Adler <[email protected]> 2 66 -
trunk/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
r18108 r19302 225 225 </File> 226 226 <File 227 RelativePath="..\..\wtf\ListHashSet.h" 228 > 229 </File> 230 <File 227 231 RelativePath="..\..\wtf\ListRefPtr.h" 228 232 > -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r19087 r19302 89 89 65621E6D089E859700760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; }; 90 90 65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; }; 91 657EB7460B708F540063461B /* ListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 657EB7450B708F540063461B /* ListHashSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 91 92 657EEBC0094E445E008C9C7B /* HashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 657EEBBF094E445E008C9C7B /* HashCountedSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 92 93 6580F796094070560082C219 /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6580F795094070560082C219 /* PassRefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 525 526 65621E6B089E859700760F35 /* property_slot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = property_slot.cpp; sourceTree = "<group>"; tabWidth = 8; }; 526 527 65621E6C089E859700760F35 /* property_slot.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = property_slot.h; sourceTree = "<group>"; tabWidth = 8; }; 528 657EB7450B708F540063461B /* ListHashSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ListHashSet.h; sourceTree = "<group>"; }; 527 529 657EEBBF094E445E008C9C7B /* HashCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashCountedSet.h; sourceTree = "<group>"; tabWidth = 8; }; 528 530 6580F795094070560082C219 /* PassRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = PassRefPtr.h; sourceTree = "<group>"; tabWidth = 8; }; … … 888 890 isa = PBXGroup; 889 891 children = ( 892 657EB7450B708F540063461B /* ListHashSet.h */, 890 893 E195678D09E7CF1200B89D13 /* unicode */, 891 894 93AA4F770957251F0084B3A7 /* AlwaysInline.h */, … … 1221 1224 E11D51760B2E798D0056C188 /* StringExtras.h in Headers */, 1222 1225 146AAB2B0B66A84900E55F16 /* JSStringRefCF.h in Headers */, 1226 657EB7460B708F540063461B /* ListHashSet.h in Headers */, 1223 1227 ); 1224 1228 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/wtf/HashTable.h
r17127 r19302 292 292 template<typename T, typename Extra, typename HashTranslator> pair<iterator, bool> add(const T& key, const Extra&); 293 293 294 iterator find(const KeyType&); 295 const_iterator find(const KeyType&) const; 296 bool contains(const KeyType&) const; 294 iterator find(const KeyType& key) { return find<KeyType, IdentityTranslatorType>(key); } 295 const_iterator find(const KeyType& key) const { return find<KeyType, IdentityTranslatorType>(key); } 296 bool contains(const KeyType& key) const { return contains<KeyType, IdentityTranslatorType>(key); } 297 298 template <typename T, typename HashTranslator> iterator find(const T&); 299 template <typename T, typename HashTranslator> const_iterator find(const T&) const; 300 template <typename T, typename HashTranslator> bool contains(const T&) const; 297 301 298 302 void remove(const KeyType&); … … 468 472 469 473 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 470 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const Key& key) 474 template <typename T, typename HashTranslator> 475 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const T& key) 471 476 { 472 477 if (!m_table) 473 478 return end(); 474 479 475 LookupType result = lookup (key);480 LookupType result = lookup<T, HashTranslator>(key).first; 476 481 if (!result.second) 477 482 return end(); … … 480 485 481 486 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 482 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::const_iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const Key& key) const 487 template <typename T, typename HashTranslator> 488 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::const_iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const T& key) const 483 489 { 484 490 if (!m_table) 485 491 return end(); 486 492 487 LookupType result = const_cast<HashTable *>(this)->lookup (key);493 LookupType result = const_cast<HashTable *>(this)->lookup<T, HashTranslator>(key).first; 488 494 if (!result.second) 489 495 return end(); … … 492 498 493 499 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 494 bool HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::contains(const KeyType& key) const 500 template <typename T, typename HashTranslator> 501 bool HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::contains(const T& key) const 495 502 { 496 503 if (!m_table) 497 504 return false; 498 505 499 return const_cast<HashTable *>(this)->lookup (key).second;506 return const_cast<HashTable *>(this)->lookup<T, HashTranslator>(key).first.second; 500 507 } 501 508
Note:
See TracChangeset
for help on using the changeset viewer.