Changeset 35027 in webkit for trunk/JavaScriptCore/kjs/PropertyMap.cpp
- Timestamp:
- Jul 6, 2008, 7:49:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/PropertyMap.cpp
r34582 r35027 64 64 static int numRemoves; 65 65 66 struct PropertyMapStatisticsExitLogger { ~PropertyMapStatisticsExitLogger(); }; 66 struct PropertyMapStatisticsExitLogger { 67 ~PropertyMapStatisticsExitLogger(); 68 }; 67 69 68 70 static PropertyMapStatisticsExitLogger logger; … … 86 88 87 89 PropertyMapEntry(UString::Rep* k, JSValue* v, int a) 88 : key(k), value(v), attributes(a), index(0) 90 : key(k) 91 , value(v) 92 , attributes(a) 93 , index(0) 89 94 { 90 95 } … … 143 148 return; 144 149 } 145 150 146 151 unsigned entryCount = m_u.table->keyCount + m_u.table->deletedSentinelCount; 147 152 for (unsigned i = 1; i <= entryCount; i++) { … … 175 180 } 176 181 177 JSValue* PropertyMap::get(const Identifier& name, unsigned& attributes) const178 { 179 ASSERT(! name.isNull());180 181 UString::Rep* rep = name._ustring.rep();182 182 JSValue* PropertyMap::get(const Identifier& propertyName, unsigned& attributes) const 183 { 184 ASSERT(!propertyName.isNull()); 185 186 UString::Rep* rep = propertyName._ustring.rep(); 187 183 188 if (!m_usingTable) { 184 189 #if USE_SINGLE_ENTRY … … 190 195 return 0; 191 196 } 192 197 193 198 unsigned i = rep->computedHash(); 194 199 … … 230 235 } 231 236 232 JSValue* PropertyMap::get(const Identifier& name) const233 { 234 ASSERT(! name.isNull());235 236 UString::Rep* rep = name._ustring.rep();237 237 JSValue* PropertyMap::get(const Identifier& propertyName) const 238 { 239 ASSERT(!propertyName.isNull()); 240 241 UString::Rep* rep = propertyName._ustring.rep(); 242 238 243 if (!m_usingTable) { 239 244 #if USE_SINGLE_ENTRY … … 243 248 return 0; 244 249 } 245 250 246 251 unsigned i = rep->computedHash(); 247 252 … … 279 284 } 280 285 281 JSValue** PropertyMap::getLocation(const Identifier& name)282 { 283 ASSERT(! name.isNull());284 285 UString::Rep* rep = name._ustring.rep();286 286 JSValue** PropertyMap::getLocation(const Identifier& propertyName) 287 { 288 ASSERT(!propertyName.isNull()); 289 290 UString::Rep* rep = propertyName._ustring.rep(); 291 287 292 if (!m_usingTable) { 288 293 #if USE_SINGLE_ENTRY … … 292 297 return 0; 293 298 } 294 299 295 300 unsigned i = rep->computedHash(); 296 301 … … 328 333 } 329 334 330 JSValue** PropertyMap::getLocation(const Identifier& name, bool& isWriteable)331 { 332 ASSERT(! name.isNull());333 334 UString::Rep* rep = name._ustring.rep();335 335 JSValue** PropertyMap::getLocation(const Identifier& propertyName, bool& isWriteable) 336 { 337 ASSERT(!propertyName.isNull()); 338 339 UString::Rep* rep = propertyName._ustring.rep(); 340 336 341 if (!m_usingTable) { 337 342 #if USE_SINGLE_ENTRY … … 343 348 return 0; 344 349 } 345 350 346 351 unsigned i = rep->computedHash(); 347 352 … … 383 388 } 384 389 385 void PropertyMap::put(const Identifier& name, JSValue* value, unsigned attributes, bool checkReadOnly)386 { 387 ASSERT(! name.isNull());390 void PropertyMap::put(const Identifier& propertyName, JSValue* value, unsigned attributes, bool checkReadOnly) 391 { 392 ASSERT(!propertyName.isNull()); 388 393 ASSERT(value); 389 394 390 395 checkConsistency(); 391 396 392 UString::Rep* rep = name._ustring.rep();393 397 UString::Rep* rep = propertyName._ustring.rep(); 398 394 399 #if USE_SINGLE_ENTRY 395 400 if (!m_usingTable) { … … 429 434 430 435 if (m_u.table->entries()[entryIndex - 1].key == rep) { 431 if (checkReadOnly && (m_u.table->entries()[entryIndex - 1].attributes & ReadOnly)) 436 if (checkReadOnly && (m_u.table->entries()[entryIndex - 1].attributes & ReadOnly)) 432 437 return; 433 438 // Put a new value in an existing hash table entry. … … 467 472 // slot that we can use. We know it will be there because we did at least one 468 473 // deletion in the past that left an entry empty. 469 while (m_u.table->entries()[--entryIndex - 1].key) 470 ; 471 } 472 474 while (m_u.table->entries()[--entryIndex - 1].key) { } 475 } 473 476 474 477 // Create a new hash table entry. … … 574 577 575 578 Table* oldTable = m_u.table; 576 579 577 580 m_u.table = static_cast<Table*>(fastZeroedMalloc(Table::allocationSize(newTableSize))); 578 581 m_u.table->size = newTableSize; … … 594 597 } 595 598 596 void PropertyMap::remove(const Identifier& name)597 { 598 ASSERT(! name.isNull());599 599 void PropertyMap::remove(const Identifier& propertyName) 600 { 601 ASSERT(!propertyName.isNull()); 602 600 603 checkConsistency(); 601 604 602 UString::Rep* rep = name._ustring.rep();605 UString::Rep* rep = propertyName._ustring.rep(); 603 606 604 607 if (!m_usingTable) {
Note:
See TracChangeset
for help on using the changeset viewer.