⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 100219 in webkit


Ignore:
Timestamp:
Nov 14, 2011, 5:04:08 PM (15 years ago)
Author:
fpizlo@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r100208 r100219  
     12011-11-14  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG put_by_id transition optimizations test the wrong structures
     4        https://bugs.webkit.org/show_bug.cgi?id=72324
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * dfg/DFGByteCodeParser.cpp:
     9        (JSC::DFG::ByteCodeParser::structureChainIsStillValid):
     10        (JSC::DFG::ByteCodeParser::parseBlock):
     11        * jit/JITPropertyAccess.cpp:
     12        (JSC::JIT::privateCompilePutByIdTransition):
     13
    1142011-11-14  Michael Saboff  <msaboff@apple.com>
    215
  • 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();
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r98912 r100219  
    522522    failureCases.append(emitJumpIfNotJSCell(regT0));
    523523    failureCases.append(branchPtr(NotEqual, Address(regT0, JSCell::structureOffset()), TrustedImmPtr(oldStructure)));
     524   
    524525    testPrototype(oldStructure->storedPrototype(), failureCases);
     526   
     527    ASSERT(oldStructure->storedPrototype().isNull() || oldStructure->storedPrototype().asCell()->structure() == chain->head()->get());
    525528
    526529    // ecx = baseObject->m_structure
    527530    if (!direct) {
    528         for (WriteBarrier<Structure>* it = chain->head(); *it; ++it)
     531        for (WriteBarrier<Structure>* it = chain->head(); *it; ++it) {
     532            ASSERT((*it)->storedPrototype().isNull() || (*it)->storedPrototype().asCell()->structure() == it[1].get());
    529533            testPrototype((*it)->storedPrototype(), failureCases);
     534        }
    530535    }
    531536
Note: See TracChangeset for help on using the changeset viewer.