Ignore:
Timestamp:
Aug 27, 2015, 12:16:07 AM (10 years ago)
Author:
[email protected]
Message:

Node::origin should always be set, and the dead zone due to SSA Phis can just use exitOK=false
https://bugs.webkit.org/show_bug.cgi?id=148462

Reviewed by Saam Barati.

The need to label nodes that absolutely cannot exit was first observed when we introduced SSA form.
We indicated this by not setting the CodeOrigin.

But just recently (http://trac.webkit.org/changeset/188979), we added a more comprehensive "exitOK"
bit in NodeOrigin. After that change, there were two ways of indicating that you cannot exit:
!exitOK and an unset NodeOrigin. An unset NodeOrigin implied !exitOK.

Now, this change is about removing the old way so that we only use !exitOK. From now on, all nodes
must have their NodeOrigin set, and the IR validation will check this. This means that I could
remove various pieces of cruft for dealing with unset NodeOrigins, but I did have to add some new
cruft to ensure that all nodes we create have a NodeOrigin.

This change simplifies our IR by having a simpler rule about when NodeOrigin is set: it's always
set.

  • dfg/DFGBasicBlock.cpp:

(JSC::DFG::BasicBlock::isInBlock):
(JSC::DFG::BasicBlock::removePredecessor):
(JSC::DFG::BasicBlock::firstOriginNode): Deleted.
(JSC::DFG::BasicBlock::firstOrigin): Deleted.

  • dfg/DFGBasicBlock.h:

(JSC::DFG::BasicBlock::begin):
(JSC::DFG::BasicBlock::end):
(JSC::DFG::BasicBlock::numSuccessors):
(JSC::DFG::BasicBlock::successor):

  • dfg/DFGCombinedLiveness.cpp:

(JSC::DFG::liveNodesAtHead):

  • dfg/DFGConstantHoistingPhase.cpp:
  • dfg/DFGCriticalEdgeBreakingPhase.cpp:

(JSC::DFG::CriticalEdgeBreakingPhase::breakCriticalEdge):

  • dfg/DFGForAllKills.h:

(JSC::DFG::forAllKilledOperands):

  • dfg/DFGIntegerRangeOptimizationPhase.cpp:
  • dfg/DFGLoopPreHeaderCreationPhase.cpp:

(JSC::DFG::createPreHeader):
(JSC::DFG::LoopPreHeaderCreationPhase::run):

  • dfg/DFGOSRAvailabilityAnalysisPhase.cpp:

(JSC::DFG::OSRAvailabilityAnalysisPhase::run):

  • dfg/DFGObjectAllocationSinkingPhase.cpp:
  • dfg/DFGPutStackSinkingPhase.cpp:
  • dfg/DFGSSAConversionPhase.cpp:

(JSC::DFG::SSAConversionPhase::run):

  • dfg/DFGValidate.cpp:

(JSC::DFG::Validate::validate):
(JSC::DFG::Validate::validateSSA):

File:
1 edited

Legend:

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

    r188979 r189013  
    15491549        HashMap<FrozenValue*, Node*> lazyMapping;
    15501550        if (!m_bottom)
    1551             m_bottom = m_insertionSet.insertConstant(0, NodeOrigin(), jsNumber(1927));
     1551            m_bottom = m_insertionSet.insertConstant(0, m_graph.block(0)->at(0)->origin, jsNumber(1927));
    15521552        for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
    15531553            m_heap = m_heapAtHead[block];
     
    16221622                    return nullptr;
    16231623
    1624                 Node* phiNode = m_graph.addNode(SpecHeapTop, Phi, NodeOrigin());
     1624                Node* phiNode = m_graph.addNode(SpecHeapTop, Phi, block->at(0)->origin.withInvalidExit());
    16251625                phiNode->mergeFlags(NodeResultJS);
    16261626                return phiNode;
     
    16391639                    return nullptr;
    16401640
    1641                 Node* phiNode = m_graph.addNode(SpecHeapTop, Phi, NodeOrigin());
     1641                Node* phiNode = m_graph.addNode(SpecHeapTop, Phi, block->at(0)->origin.withInvalidExit());
    16421642                phiNode->mergeFlags(NodeResultJS);
    16431643                return phiNode;
     
    16701670                if (m_sinkCandidates.contains(location.base())) {
    16711671                    m_insertionSet.insert(
    1672                         0, location.createHint(m_graph, NodeOrigin(), phiDef->value()));
     1672                        0,
     1673                        location.createHint(
     1674                            m_graph, block->at(0)->origin.withInvalidExit(), phiDef->value()));
    16731675                }
    16741676            }
     
    16811683                m_escapeeToMaterialization.add(identifier, phiDef->value());
    16821684                bool canExit = false;
    1683                 insertOSRHintsForUpdate(0, NodeOrigin(), canExit, availabilityCalculator.m_availability, identifier, phiDef->value());
     1685                insertOSRHintsForUpdate(
     1686                    0, block->at(0)->origin, canExit,
     1687                    availabilityCalculator.m_availability, identifier, phiDef->value());
    16841688            }
    16851689
Note: See TracChangeset for help on using the changeset viewer.