Ignore:
Timestamp:
Aug 3, 2013, 5:12:21 PM (12 years ago)
Author:
[email protected]
Message:

hasIndexingHeader() ought really to be a property of an object and its structure, not just its structure
https://bugs.webkit.org/show_bug.cgi?id=119470

Reviewed by Oliver Hunt.

Structure can still tell you if the object "could" (in the conservative sense)
have an indexing header; that's used by the compiler.

Most of the time if you want to know if there's an indexing header, you ask the
JSObject.

In some cases, the JSObject wants to know if it would have an indexing header if
it had a different structure; then it uses Structure::hasIndexingHeader(JSCell*).

  • 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/JSObject.cpp:

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

  • runtime/JSObject.h:

(JSC::JSObject::hasIndexingHeader):
(JSC::JSObject::setButterfly):

  • runtime/Structure.h:

(JSC::Structure::couldHaveIndexingHeader):
(JSC::Structure::hasIndexingHeader):

File:
1 edited

Legend:

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

    r153673 r153691  
    103103    size_t preCapacity;
    104104    size_t indexingPayloadSizeInBytes;
    105     bool hasIndexingHeader = structure->hasIndexingHeader();
     105    bool hasIndexingHeader = this->hasIndexingHeader();
    106106    if (UNLIKELY(hasIndexingHeader)) {
    107107        preCapacity = butterfly->indexingHeader()->preCapacity(structure);
     
    174174    size_t preCapacity;
    175175    size_t indexingPayloadSizeInBytes;
    176     bool hasIndexingHeader = structure->hasIndexingHeader();
     176    bool hasIndexingHeader = this->hasIndexingHeader();
    177177    if (UNLIKELY(hasIndexingHeader)) {
    178178        preCapacity = butterfly->indexingHeader()->preCapacity(structure);
Note: See TracChangeset for help on using the changeset viewer.