Changeset 36310 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 9, 2008, 7:36:47 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r36308 r36310 1 2008-09-09 Sam Weinig <[email protected]> 2 3 Reviewed by Cameron Zwarich. 4 5 Don't waste the first item in the PropertyStorage. 6 7 - Fix typo (makingCount -> markingCount) 8 - Remove undefined method declaration. 9 10 No change on Sunspider. 11 12 * kjs/JSObject.cpp: 13 (JSC::JSObject::mark): 14 * kjs/PropertyMap.cpp: 15 (JSC::PropertyMap::put): 16 (JSC::PropertyMap::remove): 17 (JSC::PropertyMap::getOffset): 18 (JSC::PropertyMap::insert): 19 (JSC::PropertyMap::rehash): 20 (JSC::PropertyMap::resizePropertyStorage): 21 (JSC::PropertyMap::checkConsistency): 22 * kjs/PropertyMap.h: 23 (JSC::PropertyMap::markingCount): Fix typo. 24 1 25 2008-09-09 Cameron Zwarich <[email protected]> 2 26 -
trunk/JavaScriptCore/kjs/JSObject.cpp
r36304 r36310 71 71 m_structureID->mark(); 72 72 73 unsigned storageSize = m_structureID->propertyMap().ma kingCount();73 unsigned storageSize = m_structureID->propertyMap().markingCount(); 74 74 if (storageSize) { 75 for (unsigned i = 1; i <=storageSize; ++i) {75 for (unsigned i = 0; i < storageSize; ++i) { 76 76 JSValue* v = m_propertyStorage[i]; 77 77 if (!v->marked()) -
trunk/JavaScriptCore/kjs/PropertyMap.cpp
r36304 r36310 150 150 return; 151 151 // Put a new value in an existing hash table entry. 152 propertyStorage[entryIndex - 1] = value;152 propertyStorage[entryIndex - 2] = value; 153 153 // Attributes are intentionally not updated. 154 slot.setExistingProperty(slotBase, entryIndex - 1);154 slot.setExistingProperty(slotBase, entryIndex - 2); 155 155 return; 156 156 } else if (entryIndex == deletedSentinelIndex) { … … 199 199 ++m_table->keyCount; 200 200 201 propertyStorage[entryIndex - 1] = value;201 propertyStorage[entryIndex - 2] = value; 202 202 203 203 if ((m_table->keyCount + m_table->deletedSentinelCount) * 2 >= m_table->size) … … 205 205 206 206 checkConsistency(propertyStorage); 207 slot.setNewProperty(slotBase, entryIndex - 1);207 slot.setNewProperty(slotBase, entryIndex - 2); 208 208 } 209 209 … … 259 259 m_table->entries()[entryIndex - 1].attributes = 0; 260 260 261 propertyStorage[entryIndex - 1] = jsUndefined();261 propertyStorage[entryIndex - 2] = jsUndefined(); 262 262 263 263 ASSERT(m_table->keyCount >= 1); … … 291 291 292 292 if (rep == m_table->entries()[entryIndex - 1].key) 293 return entryIndex - 1;293 return entryIndex - 2; 294 294 295 295 #if DUMP_PROPERTYMAP_STATS … … 311 311 312 312 if (rep == m_table->entries()[entryIndex - 1].key) 313 return entryIndex - 1;313 return entryIndex - 2; 314 314 } 315 315 } … … 336 336 if (rep == m_table->entries()[entryIndex - 1].key) { 337 337 attributes = m_table->entries()[entryIndex - 1].attributes; 338 return entryIndex - 1;338 return entryIndex - 2; 339 339 } 340 340 … … 358 358 if (rep == m_table->entries()[entryIndex - 1].key) { 359 359 attributes = m_table->entries()[entryIndex - 1].attributes; 360 return entryIndex - 1;360 return entryIndex - 2; 361 361 } 362 362 } … … 384 384 if (rep == m_table->entries()[entryIndex - 1].key) { 385 385 isWriteable = !(m_table->entries()[entryIndex - 1].attributes & ReadOnly); 386 return entryIndex - 1;386 return entryIndex - 2; 387 387 } 388 388 … … 406 406 if (rep == m_table->entries()[entryIndex - 1].key) { 407 407 isWriteable = !(m_table->entries()[entryIndex - 1].attributes & ReadOnly); 408 return entryIndex - 1;408 return entryIndex - 2; 409 409 } 410 410 } … … 445 445 m_table->entries()[entryIndex - 1] = entry; 446 446 447 propertyStorage[entryIndex - 1] = value;447 propertyStorage[entryIndex - 2] = value; 448 448 449 449 ++m_table->keyCount; … … 502 502 if (oldTable->entries()[i].key) { 503 503 lastIndexUsed = max(oldTable->entries()[i].index, lastIndexUsed); 504 insert(oldTable->entries()[i], oldPropertStorage[i ], propertyStorage);504 insert(oldTable->entries()[i], oldPropertStorage[i - 1], propertyStorage); 505 505 } 506 506 } … … 522 522 523 523 // FIXME: this can probalby use memcpy 524 for (unsigned i = 1; i <=oldSize; ++i)524 for (unsigned i = 0; i < oldSize; ++i) 525 525 propertyStorage[i] = oldPropertStorage[i]; 526 526 … … 634 634 UString::Rep* rep = m_table->entries()[c].key; 635 635 if (!rep) { 636 ASSERT(propertyStorage[c ]->isUndefined());636 ASSERT(propertyStorage[c - 1]->isUndefined()); 637 637 continue; 638 638 } -
trunk/JavaScriptCore/kjs/PropertyMap.h
r36306 r36310 102 102 103 103 unsigned size() const { return m_table ? m_table->size : 0; } 104 unsigned ma kingCount() const { return m_table ? m_table->keyCount + m_table->deletedSentinelCount : 0; }104 unsigned markingCount() const { return m_table ? m_table->keyCount + m_table->deletedSentinelCount : 0; } 105 105 106 106 void resizePropertyStorage(PropertyStorage&, unsigned oldSize); … … 110 110 typedef PropertyMapHashTable Table; 111 111 112 static bool keysMatch(const UString::Rep*, const UString::Rep*);113 112 void expand(PropertyStorage&); 114 113 void rehash(PropertyStorage&);
Note:
See TracChangeset
for help on using the changeset viewer.