Ignore:
Timestamp:
Dec 10, 2013, 6:10:46 PM (11 years ago)
Author:
[email protected]
Message:

Simplify CSE's treatment of NodeRelevantToOSR
https://bugs.webkit.org/show_bug.cgi?id=125538

Reviewed by Oliver Hunt.

Make the NodeRelevantToOSR thing obvious: if there is any MovHint on a node then the
node is relevant to OSR.

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::run):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::CSEPhase::performBlockCSE):

File:
1 edited

Legend:

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

    r160344 r160407  
    5656        m_graph.clearReplacements();
    5757       
     58        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
     59            BasicBlock* block = m_graph.block(blockIndex);
     60            if (!block)
     61                continue;
     62           
     63            // All Phis need to already be marked as relevant to OSR.
     64            if (!ASSERT_DISABLED) {
     65                for (unsigned i = 0; i < block->phis.size(); ++i)
     66                    ASSERT(block->phis[i]->flags() & NodeRelevantToOSR);
     67            }
     68           
     69            for (unsigned i = block->size(); i--;) {
     70                Node* node = block->at(i);
     71               
     72                switch (node->op()) {
     73                case SetLocal:
     74                case GetLocal: // FIXME: The GetLocal case is only necessary until we do https://bugs.webkit.org/show_bug.cgi?id=106707.
     75                    node->mergeFlags(NodeRelevantToOSR);
     76                    break;
     77                default:
     78                    node->clearFlags(NodeRelevantToOSR);
     79                    break;
     80                }
     81            }
     82        }
     83       
     84        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
     85            BasicBlock* block = m_graph.block(blockIndex);
     86            if (!block)
     87                continue;
     88           
     89            for (unsigned i = block->size(); i--;) {
     90                Node* node = block->at(i);
     91                if (!node->containsMovHint())
     92                    continue;
     93               
     94                ASSERT(node->op() != ZombieHint);
     95                node->child1()->mergeFlags(NodeRelevantToOSR);
     96            }
     97        }
     98       
    5899        if (m_graph.m_form == SSA) {
    59100            Vector<BasicBlock*> depthFirst;
     
    10221063        if (cseMode == NormalCSE)
    10231064            m_graph.performSubstitution(node);
    1024        
    1025         if (node->containsMovHint()) {
    1026             ASSERT(node->op() != ZombieHint);
    1027             node->child1()->mergeFlags(NodeRelevantToOSR);
    1028         }
    10291065       
    10301066        switch (node->op()) {
     
    13751411            m_lastSeen[i] = UINT_MAX;
    13761412       
    1377         // All Phis need to already be marked as relevant to OSR.
    1378         if (!ASSERT_DISABLED) {
    1379             for (unsigned i = 0; i < block->phis.size(); ++i)
    1380                 ASSERT(block->phis[i]->flags() & NodeRelevantToOSR);
    1381         }
    1382        
    1383         // Make all of my SetLocal and GetLocal nodes relevant to OSR, and do some other
    1384         // necessary bookkeeping.
    1385         for (unsigned i = 0; i < block->size(); ++i) {
    1386             Node* node = block->at(i);
    1387            
    1388             switch (node->op()) {
    1389             case SetLocal:
    1390             case GetLocal: // FIXME: The GetLocal case is only necessary until we do https://bugs.webkit.org/show_bug.cgi?id=106707.
    1391                 node->mergeFlags(NodeRelevantToOSR);
    1392                 break;
    1393             default:
    1394                 node->clearFlags(NodeRelevantToOSR);
    1395                 break;
    1396             }
    1397         }
    1398 
    13991413        for (m_indexInBlock = 0; m_indexInBlock < block->size(); ++m_indexInBlock) {
    14001414            m_currentNode = block->at(m_indexInBlock);
Note: See TracChangeset for help on using the changeset viewer.