Changeset 40339 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Jan 28, 2009, 4:26:28 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-28 Sam Weinig <[email protected]>

Reviewed by Geoff Garen.

Initial patch by Mark Rowe.

<rdar://problem/6519356>
REGRESSION (r36006): "out of memory" alert running dromaeo on Windows

Report the cost of the ArrayStorage vector more accurately/often.

  • runtime/JSArray.cpp: (JSC::JSArray::JSArray): Report the extra cost even for a filled array because JSString using the single character optimization and immediates wont increase the cost themselves. (JSC::JSArray::putSlowCase): Update the cost when increasing the size of the array. (JSC::JSArray::increaseVectorLength): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSArray.cpp

    r40046 r40339  
    176176    m_storage = storage;
    177177
    178     // When the array is created non-empty, its cells are filled, so it's really no worse than
    179     // a property map. Therefore don't report extra memory cost.
     178    Heap::heap(this)->reportExtraMemoryCost(storageSize(length));
    180179
    181180    checkConsistency();
     
    350349
    351350    unsigned vectorLength = storage->m_vectorLength;
     351
     352    Heap::heap(this)->reportExtraMemoryCost(storageSize(newVectorLength) - storageSize(vectorLength));
     353
    352354    if (newNumValuesInVector == storage->m_numValuesInVector + 1) {
    353355        for (unsigned j = vectorLength; j < newVectorLength; ++j)
     
    463465        return false;
    464466
     467    Heap::heap(this)->reportExtraMemoryCost(storageSize(newVectorLength) - storageSize(vectorLength));
    465468    storage->m_vectorLength = newVectorLength;
    466469
Note: See TracChangeset for help on using the changeset viewer.