Changeset 31936 in webkit for trunk/JavaScriptCore/kjs/identifier.cpp
- Timestamp:
- Apr 16, 2008, 2:30:01 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/identifier.cpp
r31677 r31936 29 29 #include <wtf/FastMalloc.h> 30 30 #include <wtf/HashSet.h> 31 #if USE(MULTIPLE_THREADS) 32 #include <wtf/ThreadSpecific.h> 33 #endif 31 34 32 35 namespace WTF { … … 51 54 typedef HashSet<UString::Rep*> IdentifierTable; 52 55 typedef HashMap<const char*, UString::Rep*, PtrHash<const char*> > LiteralIdentifierTable; 53 static IdentifierTable* table;54 static LiteralIdentifierTable* literalTable;55 56 56 57 static inline IdentifierTable& identifierTable() 57 58 { 58 ASSERT(JSLock::lockCount() > 0); 59 60 if (!table) 61 table = new IdentifierTable; 59 #if USE(MULTIPLE_THREADS) 60 static ThreadSpecific<IdentifierTable> table; 62 61 return *table; 62 #else 63 static IdentifierTable table; 64 return table; 65 #endif 63 66 } 64 67 65 68 static inline LiteralIdentifierTable& literalIdentifierTable() 66 69 { 67 ASSERT(JSLock::lockCount() > 0); 68 69 if (!literalTable) 70 literalTable = new LiteralIdentifierTable; 71 return *literalTable; 72 } 73 70 #if USE(MULTIPLE_THREADS) 71 static ThreadSpecific<LiteralIdentifierTable> table; 72 return *table; 73 #else 74 static LiteralIdentifierTable table; 75 return table; 76 #endif 77 } 78 79 void Identifier::initializeIdentifierThreading() 80 { 81 identifierTable(); 82 literalIdentifierTable(); 83 } 74 84 75 85 bool Identifier::equal(const UString::Rep *r, const char *s)
Note:
See TracChangeset
for help on using the changeset viewer.