Skip to content
  • barraclough@apple.com's avatar
    https://bugs.webkit.org/show_bug.cgi?id=75151 · 617f4646
    barraclough@apple.com authored
    Add attributes field to JSArray's SparseMap
    
    Reviewed by Sam Weinig.
    
    This will be necessary to be able to support non- writable/configurable/enumerable
    properties, and helpful for getters/setters.
    
    Added a concept of being 'inSparseMode' - this indicates the array has a non-standard
    
    * runtime/ArrayPrototype.cpp:
    (JSC::arrayProtoFuncSort):
        - JSArray::sort methods not allowed on arrays that are 'inSparseMode'.
          (must fall back to generic sort alogrithm).
    * runtime/JSArray.cpp:
    (JSC::JSArray::finishCreation):
        - moved reportedMapCapacity into the SparseArrayValueMap object.
    (JSC::SparseArrayValueMap::find):
    (JSC::SparseArrayValueMap::put):
    (JSC::SparseArrayValueMap::visitChildren):
        - Added.
    (JSC::JSArray::getOwnPropertySlotByIndex):
    (JSC::JSArray::getOwnPropertyDescriptor):
    (JSC::JSArray::putSlowCase):
    (JSC::JSArray::deletePropertyByIndex):
    (JSC::JSArray::getOwnPropertyNames):
    (JSC::JSArray::setLength):
    (JSC::JSArray::pop):
    (JSC::JSArray::visitChildren):
        - Updated for changes in SparseArrayValueMap.
    (JSC::JSArray::sortNumeric):
    (JSC::JSArray::sort):
    (JSC::JSArray::compactForSorting):
        - Disallow on 'SparseMode' arrays.
    * runtime/JSArray.h:
    (JSC::SparseArrayEntry::SparseArrayEntry):
        - An entry in the sparse array - value (WriteBarrier) + attributes.
    (JSC::SparseArrayValueMap::SparseArrayValueMap):
    (JSC::SparseArrayValueMap::sparseMode):
    (JSC::SparseArrayValueMap::setSparseMode):
        - Flags to track whether an Array is forced into SparseMode.
    (JSC::SparseArrayValueMap::remove):
    (JSC::SparseArrayValueMap::notFound):
    (JSC::SparseArrayValueMap::isEmpty):
    (JSC::SparseArrayValueMap::contains):
    (JSC::SparseArrayValueMap::size):
    (JSC::SparseArrayValueMap::begin):
    (JSC::SparseArrayValueMap::end):
        - accessors to the map
    (JSC::SparseArrayValueMap::take):
        - only for use on non-SpareMode arrays.
    (JSC::JSArray::inSparseMode):
        - Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    617f4646