• mhahnenberg@apple.com's avatar
    Replace JSArray destructor with finalizer · 59415ea5
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=77488
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore: 
    
    * JavaScriptCore.exp:
    * runtime/JSArray.cpp:
    (JSC::JSArray::finalize): Added finalizer.
    (JSC::JSArray::allocateSparseMap): Factored out code for allocating new sparse maps.
    (JSC):
    (JSC::JSArray::deallocateSparseMap): Factored out code for deallocating sparse maps.
    (JSC::JSArray::enterDictionaryMode): Renamed enterSparseMode to enterDictionaryMode 
    because the old name was confusing because we could have a sparse array that never 
    called enterSparseMode.
    (JSC::JSArray::defineOwnNumericProperty):
    (JSC::JSArray::setLengthWritable):
    (JSC::JSArray::putByIndexBeyondVectorLength):
    (JSC::JSArray::setLength):
    (JSC::JSArray::pop):
    (JSC::JSArray::sort):
    (JSC::JSArray::compactForSorting):
    * runtime/JSArray.h:
    (JSArray):
    
    LayoutTests: 
    
    * fast/js/script-tests/sparse-array.js: Added code to test oscillation between 
    sparse and dense arrays.
    * fast/js/sparse-array-expected.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    59415ea5
JSArray.cpp 71.6 KB