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

Changeset 117819 in webkit


Ignore:
Timestamp:
May 21, 2012, 2:52:08 PM (14 years ago)
Author:
fpizlo@apple.com
Message:

DFG should not do unnecessary indirections when storing to objects
https://bugs.webkit.org/show_bug.cgi?id=86959

Reviewed by Oliver Hunt.

  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::getByOffsetLoadElimination):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

Location:
branches/dfgopt/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/dfgopt/Source/JavaScriptCore/ChangeLog

    r117543 r117819  
     12012-05-20  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG should not do unnecessary indirections when storing to objects
     4        https://bugs.webkit.org/show_bug.cgi?id=86959
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * dfg/DFGByteCodeParser.cpp:
     9        (JSC::DFG::ByteCodeParser::parseBlock):
     10        * dfg/DFGCSEPhase.cpp:
     11        (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
     12        * dfg/DFGSpeculativeJIT32_64.cpp:
     13        (JSC::DFG::SpeculativeJIT::compile):
     14        * dfg/DFGSpeculativeJIT64.cpp:
     15        (JSC::DFG::SpeculativeJIT::compile):
     16
    1172012-05-17  Filip Pizlo  <fpizlo@apple.com>
    218
  • branches/dfgopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r117542 r117819  
    20502050            if (!hasExitSite && putByIdStatus.isSimpleReplace()) {
    20512051                addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(putByIdStatus.oldStructure())), base);
    2052                 addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), base, addToGraph(GetPropertyStorage, base), value);
     2052                size_t offsetOffset;
     2053                NodeIndex propertyStorage;
     2054                if (putByIdStatus.oldStructure()->isUsingInlineStorage()) {
     2055                    propertyStorage = base;
     2056                    ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue)));
     2057                    offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue);
     2058                } else {
     2059                    propertyStorage = addToGraph(GetPropertyStorage, base);
     2060                    offsetOffset = 0;
     2061                }
     2062                addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), propertyStorage, base, value);
    20532063               
    20542064                StorageAccessData storageAccessData;
    2055                 storageAccessData.offset = putByIdStatus.offset();
     2065                storageAccessData.offset = putByIdStatus.offset() + offsetOffset;
    20562066                storageAccessData.identifierNumber = identifierNumber;
    20572067                m_graph.m_storageAccessData.append(storageAccessData);
     
    20922102                    base);
    20932103               
     2104                size_t offsetOffset;
     2105                NodeIndex propertyStorage;
     2106                if (putByIdStatus.newStructure()->isUsingInlineStorage()) {
     2107                    propertyStorage = base;
     2108                    ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue)));
     2109                    offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue);
     2110                } else {
     2111                    propertyStorage = addToGraph(GetPropertyStorage, base);
     2112                    offsetOffset = 0;
     2113                }
    20942114                addToGraph(
    20952115                    PutByOffset,
    20962116                    OpInfo(m_graph.m_storageAccessData.size()),
     2117                    propertyStorage,
    20972118                    base,
    2098                     addToGraph(GetPropertyStorage, base),
    20992119                    value);
    21002120               
    21012121                StorageAccessData storageAccessData;
    2102                 storageAccessData.offset = putByIdStatus.offset();
     2122                storageAccessData.offset = putByIdStatus.offset() + offsetOffset;
    21032123                storageAccessData.identifierNumber = identifierNumber;
    21042124                m_graph.m_storageAccessData.append(storageAccessData);
  • branches/dfgopt/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp

    r117017 r117819  
    308308        for (unsigned i = m_indexInBlock; i--;) {
    309309            NodeIndex index = m_currentBlock->at(i);
    310             if (index == child1) 
     310            if (index == child1)
    311311                break;
    312312
     
    321321            case PutByOffset:
    322322                if (m_graph.m_storageAccessData[node.storageAccessDataIndex()].identifierNumber == identifierNumber) {
    323                     if (node.child2() == child1)
     323                    if (node.child1() == child1) // Must be same property storage.
    324324                        return node.child3().index();
    325325                    return NoNode;
  • branches/dfgopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r117542 r117819  
    35383538    case PutByOffset: {
    35393539#if ENABLE(GGC) || ENABLE(WRITE_BARRIER_PROFILING)
    3540         SpeculateCellOperand base(this, node.child1());
     3540        SpeculateCellOperand base(this, node.child2());
    35413541#endif
    3542         StorageOperand storage(this, node.child2());
     3542        StorageOperand storage(this, node.child1());
    35433543        JSValueOperand value(this, node.child3());
    35443544
  • branches/dfgopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r117542 r117819  
    35393539    case PutByOffset: {
    35403540#if ENABLE(GGC) || ENABLE(WRITE_BARRIER_PROFILING)
    3541         SpeculateCellOperand base(this, node.child1());
     3541        SpeculateCellOperand base(this, node.child2());
    35423542#endif
    3543         StorageOperand storage(this, node.child2());
     3543        StorageOperand storage(this, node.child1());
    35443544        JSValueOperand value(this, node.child3());
    35453545
Note: See TracChangeset for help on using the changeset viewer.