Changeset 145578 in webkit


Ignore:
Timestamp:
Mar 12, 2013 1:38:26 PM (11 years ago)
Author:
fpizlo@apple.com
Message:

DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
https://bugs.webkit.org/show_bug.cgi?id=112183

Reviewed by Oliver Hunt.

Slight speed-up on string-unpack-code.

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
(FixupPhase):
(JSC::DFG::FixupPhase::checkArray):
(JSC::DFG::FixupPhase::blessArrayOperation):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r145551 r145578  
     12013-03-12  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG generic array access cases should not be guarded by CheckStructure even of the profiling tells us that it could be
     4        https://bugs.webkit.org/show_bug.cgi?id=112183
     5
     6        Reviewed by Oliver Hunt.
     7       
     8        Slight speed-up on string-unpack-code.
     9
     10        * dfg/DFGFixupPhase.cpp:
     11        (JSC::DFG::FixupPhase::findAndRemoveUnnecessaryStructureCheck):
     12        (FixupPhase):
     13        (JSC::DFG::FixupPhase::checkArray):
     14        (JSC::DFG::FixupPhase::blessArrayOperation):
     15
    1162013-03-12  Gabor Rapcsanyi  <rgabor@webkit.org>
    217
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r145052 r145578  
    839839    }
    840840   
    841     Node* checkArray(ArrayMode arrayMode, CodeOrigin codeOrigin, Node* array, Node* index, bool (*storageCheck)(const ArrayMode&) = canCSEStorage)
     841    void findAndRemoveUnnecessaryStructureCheck(Node* array, const CodeOrigin& codeOrigin)
     842    {
     843        for (unsigned index = m_indexInBlock; index--;) {
     844            Node* previousNode = m_block->at(index);
     845            if (previousNode->codeOrigin != codeOrigin)
     846                return;
     847           
     848            if (previousNode->op() != CheckStructure)
     849                continue;
     850           
     851            if (previousNode->child1() != array)
     852                continue;
     853           
     854            previousNode->child1() = Edge();
     855            previousNode->convertToPhantom();
     856            return; // Assume we were smart enough to only insert one CheckStructure on the array.
     857        }
     858    }
     859   
     860    Node* checkArray(ArrayMode arrayMode, const CodeOrigin& codeOrigin, Node* array, Node* index, bool (*storageCheck)(const ArrayMode&) = canCSEStorage)
    842861    {
    843862        ASSERT(arrayMode.isSpecific());
     
    851870                if (m_indexInBlock > 0) {
    852871                    // If the previous node was a CheckStructure inserted because of stuff
    853                     // that the array profile told us, then remove it.
    854                     Node* previousNode = m_block->at(m_indexInBlock - 1);
    855                     if (previousNode->op() == CheckStructure
    856                         && previousNode->child1() == array
    857                         && previousNode->codeOrigin == codeOrigin)
    858                         previousNode->convertToPhantom();
     872                    // that the array profile told us, then remove it, since we're going to be
     873                    // doing arrayification instead.
     874                    findAndRemoveUnnecessaryStructureCheck(array, codeOrigin);
    859875                }
    860876               
     
    909925           
    910926        case Array::Generic:
     927            findAndRemoveUnnecessaryStructureCheck(base.node(), node->codeOrigin);
    911928            return;
    912929           
Note: See TracChangeset for help on using the changeset viewer.