Changeset 52856 in webkit for trunk/JavaScriptCore/runtime/Identifier.cpp
- Timestamp:
- Jan 6, 2010, 11:33:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Identifier.cpp
r52762 r52856 29 29 #include <wtf/HashSet.h> 30 30 31 using WTF::ThreadSpecific; 32 31 33 namespace JSC { 32 34 … … 39 41 HashSet<UString::Rep*>::iterator end = m_table.end(); 40 42 for (HashSet<UString::Rep*>::iterator iter = m_table.begin(); iter != end; ++iter) 41 (*iter)->setI dentifierTable(0);43 (*iter)->setIsIdentifier(false); 42 44 } 43 45 … … 45 47 { 46 48 std::pair<HashSet<UString::Rep*>::iterator, bool> result = m_table.add(value); 47 (*result.first)->setI dentifierTable(this);49 (*result.first)->setIsIdentifier(true); 48 50 return result; 49 51 } … … 53 55 { 54 56 std::pair<HashSet<UString::Rep*>::iterator, bool> result = m_table.add<U, V>(value); 55 (*result.first)->setI dentifierTable(this);57 (*result.first)->setIsIdentifier(true); 56 58 return result; 57 59 } … … 239 241 void Identifier::remove(UString::Rep* r) 240 242 { 241 r->identifierTable()->remove(r);243 currentIdentifierTable()->remove(r); 242 244 } 243 245 244 246 #ifndef NDEBUG 245 247 246 void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep* rep)247 { 248 ASSERT( rep->identifierTable() == exec->globalData().identifierTable);249 } 250 251 void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep* rep)252 { 253 ASSERT( rep->identifierTable() == globalData->identifierTable);248 void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep*) 249 { 250 ASSERT(exec->globalData().identifierTable == currentIdentifierTable()); 251 } 252 253 void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep*) 254 { 255 ASSERT(globalData->identifierTable == currentIdentifierTable()); 254 256 } 255 257 … … 266 268 #endif 267 269 270 ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific = 0; 271 272 #if ENABLE(JSC_MULTIPLE_THREADS) 273 274 pthread_once_t createIdentifierTableSpecificOnce = PTHREAD_ONCE_INIT; 275 void createIdentifierTableSpecificCallback() 276 { 277 ASSERT(!g_identifierTableSpecific); 278 g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>(); 279 } 280 void createIdentifierTableSpecific() 281 { 282 pthread_once(&createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback); 283 ASSERT(g_identifierTableSpecific); 284 } 285 286 #else 287 288 void createDefaultDataSpecific() 289 { 290 ASSERT(!g_identifierTableSpecific); 291 g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>(); 292 } 293 294 #endif 295 268 296 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.