Changeset 53025 in webkit for trunk/JavaScriptCore/runtime/JSArray.cpp
- Timestamp:
- Jan 8, 2010, 5:02:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSArray.cpp
r52956 r53025 330 330 331 331 // We miss some cases where we could compact the storage, such as a large array that is being filled from the end 332 // (which will only be compacted as we reach indices that are less than cutoff) - but this makes the check much faster.332 // (which will only be compacted as we reach indices that are less than MIN_SPARSE_ARRAY_INDEX) - but this makes the check much faster. 333 333 if ((i > MAX_STORAGE_VECTOR_INDEX) || !isDenseEnoughForVector(i + 1, storage->m_numValuesInVector + 1)) { 334 334 if (!map) { … … 336 336 storage->m_sparseValueMap = map; 337 337 } 338 map->set(i, value); 338 339 pair<SparseArrayValueMap::iterator, bool> result = map->add(i, value); 340 if (!result.second) { // pre-existing entry 341 result.first->second = value; 342 return; 343 } 344 345 size_t capacity = map->capacity(); 346 if (capacity != storage->reportedMapCapacity) { 347 Heap::heap(this)->reportExtraMemoryCost((capacity - storage->reportedMapCapacity) * (sizeof(unsigned) + sizeof(JSValue))); 348 storage->reportedMapCapacity = capacity; 349 } 339 350 return; 340 351 }
Note:
See TracChangeset
for help on using the changeset viewer.