Ignore:
Timestamp:
Nov 3, 2016, 9:38:58 PM (9 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r208364.
https://bugs.webkit.org/show_bug.cgi?id=164402

broke the build (Requested by smfr on #webkit).

Reverted changeset:

"DFG plays fast and loose with the shadow values of a Phi"
https://bugs.webkit.org/show_bug.cgi?id=164309
http://trac.webkit.org/changeset/208364

File:
1 edited

Legend:

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

    r208364 r208367  
    4242InPlaceAbstractState::InPlaceAbstractState(Graph& graph)
    4343    : m_graph(graph)
    44     , m_abstractValues(*graph.m_abstractValuesCache)
     44    , m_abstractValues(graph.abstractValuesCache())
    4545    , m_variables(m_graph.m_codeBlock->numParameters(), graph.m_localVars)
    4646    , m_block(0)
     
    5858    ASSERT(basicBlock->variablesAtHead.numberOfLocals() == basicBlock->variablesAtTail.numberOfLocals());
    5959
    60     m_abstractValues.resize();
    61    
    62     for (size_t i = 0; i < basicBlock->size(); i++) {
    63         NodeFlowProjection::forEach(
    64             basicBlock->at(i), [&] (NodeFlowProjection nodeProjection) {
    65                 forNode(nodeProjection).clear();
    66             });
    67     }
     60    // Certain phases insert nodes in a block after running through it.
     61    // We cannot reserve the space for AbstractValues when initializing AbstractState because the number of values
     62    // can increase as we execute. Instead, we increase the size as needed before processing each block.
     63    m_abstractValues.resize(m_graph.maxNodeCount());
     64   
     65    for (size_t i = 0; i < basicBlock->size(); i++)
     66        forNode(basicBlock->at(i)).clear();
    6867
    6968    m_variables = basicBlock->valuesAtHead;
    7069   
    7170    if (m_graph.m_form == SSA) {
    72         for (NodeAbstractValuePair& entry : basicBlock->ssa->valuesAtHead) {
    73             if (entry.node.isStillValid())
    74                 forNode(entry.node) = entry.value;
    75         }
     71        for (auto& entry : basicBlock->ssa->valuesAtHead)
     72            forNode(entry.node) = entry.value;
    7673    }
    7774    basicBlock->cfaShouldRevisit = false;
     
    8481}
    8582
    86 static void setLiveValues(Vector<NodeAbstractValuePair>& values, const Vector<NodeFlowProjection>& live)
     83static void setLiveValues(Vector<BasicBlock::SSAData::NodeAbstractValuePair>& values, const Vector<Node*>& live)
    8784{
    8885    values.resize(0);
    8986    values.reserveCapacity(live.size());
    90     for (NodeFlowProjection node : live)
    91         values.uncheckedAppend(NodeAbstractValuePair { node, AbstractValue() });
     87    for (Node* node : live)
     88        values.uncheckedAppend(BasicBlock::SSAData::NodeAbstractValuePair { node, AbstractValue() });
    9289}
    9390
     
    203200            block->valuesAtTail[i].merge(m_variables[i]);
    204201
    205         for (NodeAbstractValuePair& valueAtTail : block->ssa->valuesAtTail) {
     202        for (auto& valueAtTail : block->ssa->valuesAtTail) {
    206203            AbstractValue& valueAtNode = forNode(valueAtTail.node);
    207204            valueAtTail.value.merge(valueAtNode);
     
    295292            changed |= to->valuesAtHead[i].merge(from->valuesAtTail[i]);
    296293
    297         for (NodeAbstractValuePair& entry : to->ssa->valuesAtHead) {
    298             NodeFlowProjection node = entry.node;
     294        for (auto& entry : to->ssa->valuesAtHead) {
     295            Node* node = entry.node;
    299296            if (verbose)
    300297                dataLog("      Merging for ", node, ": from ", forNode(node), " to ", entry.value, "\n");
    301298#ifndef NDEBUG
    302299            unsigned valueCountInFromBlock = 0;
    303             for (NodeAbstractValuePair& fromBlockValueAtTail : from->ssa->valuesAtTail) {
     300            for (auto& fromBlockValueAtTail : from->ssa->valuesAtTail) {
    304301                if (fromBlockValueAtTail.node == node) {
    305302                    ASSERT(fromBlockValueAtTail.value == forNode(node));
Note: See TracChangeset for help on using the changeset viewer.