Ignore:
Timestamp:
Nov 14, 2011, 5:04:08 PM (14 years ago)
Author:
[email protected]
Message:

DFG put_by_id transition optimizations test the wrong structures
https://bugs.webkit.org/show_bug.cgi?id=72324

Reviewed by Gavin Barraclough.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::structureChainIsStillValid):
(JSC::DFG::ByteCodeParser::parseBlock):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::privateCompilePutByIdTransition):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r99898 r100219  
    683683       
    684684        return nodeIndex;
     685    }
     686   
     687    bool structureChainIsStillValid(bool direct, Structure* previousStructure, StructureChain* chain)
     688    {
     689        if (direct)
     690            return true;
     691       
     692        if (!previousStructure->storedPrototype().isNull() && previousStructure->storedPrototype().asCell()->structure() != chain->head()->get())
     693            return false;
     694       
     695        for (WriteBarrier<Structure>* it = chain->head(); *it; ++it) {
     696            if (!(*it)->storedPrototype().isNull() && (*it)->storedPrototype().asCell()->structure() != it[1].get())
     697                return false;
     698        }
     699       
     700        return true;
    685701    }
    686702   
     
    18041820                    size_t offset = newStructure->get(*m_globalData, identifier);
    18051821                   
    1806                     if (offset != notFound) {
     1822                    if (offset != notFound && structureChainIsStillValid(direct, previousStructure, structureChain)) {
    18071823                        addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(previousStructure)), base);
    18081824                        if (!direct) {
     1825                            if (!previousStructure->storedPrototype().isNull())
     1826                                addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(previousStructure->storedPrototype().asCell()->structure())), cellConstant(previousStructure->storedPrototype().asCell()));
     1827                           
    18091828                            for (WriteBarrier<Structure>* it = structureChain->head(); *it; ++it) {
    18101829                                JSValue prototype = (*it)->storedPrototype();
Note: See TracChangeset for help on using the changeset viewer.