Ignore:
Timestamp:
Jan 31, 2015, 7:58:39 PM (10 years ago)
Author:
[email protected]
Message:

Crash (DFG assertion) beneath AbstractInterpreter::verifyEdge() @ http://experilous.com/1/planet-generator/2014-09-28/version-1
https://bugs.webkit.org/show_bug.cgi?id=141111

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

In LowerDFGToLLVM::compileNode(), if we determine while compiling a node that we would have
exited, we don't need to process the OSR availability or abstract interpreter.

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::safelyInvalidateAfterTermination): Broke this out a a separate
method since we need to call it at the top and near the bottom of compileNode().
(JSC::FTL::LowerDFGToLLVM::compileNode):

LayoutTests:

New tests.

  • js/regress-141111-expected.txt: Added.
  • js/regress-141111.html: Added.
  • js/script-tests/regress-141111.js: Added.

(MyObject):
(foo):
(.result):
(bar):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r178856 r179457  
    307307        }
    308308    }
    309    
     309
     310    void safelyInvalidateAfterTermination()
     311    {
     312        if (verboseCompilationEnabled())
     313            dataLog("Bailing.\n");
     314        crash(m_highBlock->index, m_node->index());
     315
     316        // Invalidate dominated blocks. Under normal circumstances we would expect
     317        // them to be invalidated already. But you can have the CFA become more
     318        // precise over time because the structures of objects change on the main
     319        // thread. Failing to do this would result in weird crashes due to a value
     320        // being used but not defined. Race conditions FTW!
     321        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
     322            BasicBlock* target = m_graph.block(blockIndex);
     323            if (!target)
     324                continue;
     325            if (m_graph.m_dominators.dominates(m_highBlock, target)) {
     326                if (verboseCompilationEnabled())
     327                    dataLog("Block ", *target, " will bail also.\n");
     328                target->cfaHasVisited = false;
     329            }
     330        }
     331    }
     332
    310333    bool compileNode(unsigned nodeIndex)
    311334    {
    312335        if (!m_state.isValid()) {
    313             if (verboseCompilationEnabled())
    314                 dataLog("Bailing.\n");
    315             crash(m_highBlock->index, m_node->index());
    316            
    317             // Invalidate dominated blocks. Under normal circumstances we would expect
    318             // them to be invalidated already. But you can have the CFA become more
    319             // precise over time because the structures of objects change on the main
    320             // thread. Failing to do this would result in weird crashes due to a value
    321             // being used but not defined. Race conditions FTW!
    322             for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
    323                 BasicBlock* target = m_graph.block(blockIndex);
    324                 if (!target)
    325                     continue;
    326                 if (m_graph.m_dominators.dominates(m_highBlock, target)) {
    327                     if (verboseCompilationEnabled())
    328                         dataLog("Block ", *target, " will bail also.\n");
    329                     target->cfaHasVisited = false;
    330                 }
    331             }
    332            
     336            safelyInvalidateAfterTermination();
    333337            return false;
    334338        }
     
    750754            break;
    751755        }
    752        
     756
     757        if (!m_state.isValid()) {
     758            safelyInvalidateAfterTermination();
     759            return false;
     760        }
     761
    753762        m_availabilityCalculator.executeNode(m_node);
    754763        m_interpreter.executeEffects(nodeIndex);
Note: See TracChangeset for help on using the changeset viewer.