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/Structure.h

    r153657 r153691  
    229229    }
    230230   
    231     bool hasIndexingHeader() const
     231    bool couldHaveIndexingHeader() const
    232232    {
    233233        return hasIndexedProperties(indexingType());
    234234    }
    235 
     235   
     236    bool hasIndexingHeader(const JSCell*) const
     237    {
     238        return hasIndexedProperties(indexingType());
     239    }
     240   
    236241    bool masqueradesAsUndefined(JSGlobalObject* lexicalGlobalObject);
    237242
Note: See TracChangeset for help on using the changeset viewer.