Changeset 28777 in webkit for trunk/JavaScriptCore/kjs/SymbolTable.h
- Timestamp:
- Dec 16, 2007, 2:53:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/SymbolTable.h
r27198 r28777 30 30 #define SymbolTable_h 31 31 32 #include " property_map.h"33 #include "AlwaysInline.h"32 #include "ustring.h" 33 #include <wtf/AlwaysInline.h> 34 34 35 35 namespace KJS { 36 36 37 class JSValue; 37 struct IdentifierRepHash { 38 static unsigned hash(const RefPtr<UString::Rep>& key) { return key->computedHash(); } 39 static bool equal(const RefPtr<UString::Rep>& a, const RefPtr<UString::Rep>& b) { return a == b; } 40 static const bool safeToCompareToEmptyOrDeleted = true; 41 }; 38 42 39 struct IdentifierRepHash { 40 static unsigned hash(const KJS::UString::Rep *key) { return key->computedHash(); } 41 static bool equal(const KJS::UString::Rep *a, const KJS::UString::Rep *b) { return a == b; } 42 static const bool safeToCompareToEmptyOrDeleted = true; 43 struct IdentifierRepHashTraits : HashTraits<RefPtr<UString::Rep> > { 44 static const RefPtr<UString::Rep>& deletedValue() 45 { 46 return *reinterpret_cast<RefPtr<UString::Rep>*>(&nullRepPtr); 47 } 48 49 private: 50 static UString::Rep* nullRepPtr; 43 51 }; 44 52 … … 54 62 }; 55 63 56 typedef HashMap< UString::Rep*, size_t, IdentifierRepHash, HashTraits<UString::Rep*>, SymbolTableIndexHashTraits> SymbolTable;64 typedef HashMap<RefPtr<UString::Rep>, size_t, IdentifierRepHash, IdentifierRepHashTraits, SymbolTableIndexHashTraits> SymbolTable; 57 65 58 66 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.