Changeset 37985 in webkit for trunk/JavaScriptCore/runtime/StructureID.h
- Timestamp:
- Oct 29, 2008, 4:52:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/StructureID.h
r37981 r37985 31 31 #include "JSValue.h" 32 32 #include "PropertyMap.h" 33 #include "StructureIDTransitionTable.h" 33 34 #include "TypeInfo.h" 34 35 #include "ustring.h" … … 46 47 class PropertyNameArrayData; 47 48 class StructureIDChain; 48 49 struct TransitionTableHash {50 typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey;51 static unsigned hash(const TransitionTableKey& p)52 {53 return p.first->computedHash();54 }55 56 static bool equal(const TransitionTableKey& a, const TransitionTableKey& b)57 {58 return a == b;59 }60 61 static const bool safeToCompareToEmptyOrDeleted = true;62 };63 64 struct TransitionTableHashTraits {65 typedef WTF::HashTraits<RefPtr<UString::Rep> > FirstTraits;66 typedef WTF::GenericHashTraits<unsigned> SecondTraits;67 typedef std::pair<FirstTraits::TraitType, SecondTraits::TraitType> TraitType;68 69 static const bool emptyValueIsZero = FirstTraits::emptyValueIsZero && SecondTraits::emptyValueIsZero;70 static TraitType emptyValue() { return std::make_pair(FirstTraits::emptyValue(), SecondTraits::emptyValue()); }71 72 static const bool needsDestruction = FirstTraits::needsDestruction || SecondTraits::needsDestruction;73 74 static void constructDeletedValue(TraitType& slot) { FirstTraits::constructDeletedValue(slot.first); }75 static bool isDeletedValue(const TraitType& value) { return FirstTraits::isDeletedValue(value.first); }76 };77 49 78 50 class StructureID : public RefCounted<StructureID> { … … 141 113 142 114 private: 143 typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey;144 typedef HashMap<TransitionTableKey, StructureID*, TransitionTableHash, TransitionTableHashTraits> TransitionTable;145 146 115 StructureID(JSValue* prototype, const TypeInfo&); 147 116 … … 159 128 union { 160 129 StructureID* singleTransition; 161 TransitionTable* table;130 StructureIDTransitionTable* table; 162 131 } m_transitions; 163 132
Note:
See TracChangeset
for help on using the changeset viewer.