Ignore:
Timestamp:
Aug 2, 2013, 11:27:51 AM (12 years ago)
Author:
[email protected]
Message:

hasIndexingHeader should be a property of the Structure, not just the IndexingType
https://bugs.webkit.org/show_bug.cgi?id=119422

Reviewed by Oliver Hunt.

This simplifies some code and also allows Structure to claim that an object
has an indexing header even if it doesn't have indexed properties.

I also changed some calls to use hasIndexedProperties() since in some cases,
that's what we actually meant. Currently the two are synonyms.

  • dfg/DFGRepatch.cpp:

(JSC::DFG::tryCachePutByID):
(JSC::DFG::tryBuildPutByIdList):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):

  • runtime/ButterflyInlines.h:

(JSC::Butterfly::create):
(JSC::Butterfly::growPropertyStorage):
(JSC::Butterfly::growArrayRight):
(JSC::Butterfly::resizeArray):

  • runtime/IndexingType.h:
  • runtime/JSObject.cpp:

(JSC::JSObject::copyButterfly):
(JSC::JSObject::visitButterfly):
(JSC::JSObject::setPrototype):

  • runtime/JSObject.h:

(JSC::JSObject::setButterfly):

  • runtime/JSPropertyNameIterator.cpp:

(JSC::JSPropertyNameIterator::create):

  • runtime/Structure.h:

(JSC::Structure::hasIndexingHeader):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r153556 r153657  
    103103    size_t preCapacity;
    104104    size_t indexingPayloadSizeInBytes;
    105     bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());
     105    bool hasIndexingHeader = structure->hasIndexingHeader();
    106106    if (UNLIKELY(hasIndexingHeader)) {
    107107        preCapacity = butterfly->indexingHeader()->preCapacity(structure);
     
    149149                break;
    150150            }
     151               
    151152            default:
    152                 CRASH();
    153153                currentTarget = 0;
    154154                currentSource = 0;
     
    174174    size_t preCapacity;
    175175    size_t indexingPayloadSizeInBytes;
    176     bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());
     176    bool hasIndexingHeader = structure->hasIndexingHeader();
    177177    if (UNLIKELY(hasIndexingHeader)) {
    178178        preCapacity = butterfly->indexingHeader()->preCapacity(structure);
     
    11471147    }
    11481148   
    1149     if (!hasIndexingHeader(structure()->indexingType()))
     1149    if (!hasIndexedProperties(structure()->indexingType()))
    11501150        return;
    11511151   
Note: See TracChangeset for help on using the changeset viewer.