Ignore:
Timestamp:
Apr 28, 2008, 10:18:15 AM (17 years ago)
Author:
Darin Adler
Message:

2008-04-28 Darin Adler <Darin Adler>

Reviewed by Adam.

  • make sure RefPtr's default hash doesn't ref/deref when computing the hash
  • remove remnants of the hash table storage type optimization
  • wtf/HashFunctions.h: Used "using" to get the hash and equal functions from PtrHash<P*> into PtrHash<RefPtr<P>>.
  • wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits. Eliminated storage-related typedefs. Removed constructor, destructor, copy constructor, and destructor since the compiler-generated ones are fine. Removed refAll and derefAll. Took out unnnecessary typecasts. Removed use of RefCounter.
  • wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor, destructor, copy constructor, and destructor since the compiler-generated ones are fine. Removed refAll and derefAll. Removed unneeded template arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator template.
  • wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase, RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner class templates.
  • wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits, and HashKeyStorageTraits.
  • wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made the corresponding changes to RefPtrHashMapRawKeyTranslator.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashTraits.h

    r32609 r32650  
    9393    template<typename T> struct GenericHashTraits : GenericHashTraitsBase<IsInteger<T>::value, T> {
    9494        typedef T TraitType;
    95         typedef HashTraits<T> StorageTraits;
    9695        static T emptyValue() { return T(); }
    97         static const bool needsRef = false;
    9896    };
    9997
     
    125123    // special traits for pairs, helpful for their use in HashMap implementation
    126124
    127     template<typename FirstTraits, typename SecondTraits> struct PairHashTraits;
    128 
    129125    template<typename FirstTraitsArg, typename SecondTraitsArg>
    130126    struct PairHashTraits : GenericHashTraits<pair<typename FirstTraitsArg::TraitType, typename SecondTraitsArg::TraitType> > {
     
    142138    };
    143139
    144     template<typename FirstTraits, typename SecondTraits>
    145     struct PairBaseHashTraits : PairHashTraits<FirstTraits, SecondTraits> { };
    146 
    147140    template<typename First, typename Second>
    148141    struct HashTraits<pair<First, Second> > : public PairHashTraits<HashTraits<First>, HashTraits<Second> > { };
    149 
    150     // obsolete code sharing traits -- to be deleted
    151     template<typename HashArg, typename TraitsArg> struct HashKeyStorageTraits {
    152         typedef HashArg Hash;
    153         typedef TraitsArg Traits;
    154     };
    155142
    156143} // namespace WTF
Note: See TracChangeset for help on using the changeset viewer.