Ignore:
Timestamp:
Sep 5, 2017, 2:30:05 PM (8 years ago)
Author:
[email protected]
Message:

Make the distinction between entrypoints and CFG roots more clear by naming things better
https://bugs.webkit.org/show_bug.cgi?id=176336

Reviewed by Mark Lam and Keith Miller and Michael Saboff.

This patch does renaming to make the distinction between Graph::m_entrypoints
and Graph::m_numberOfEntrypoints more clear. The source of confusion is that
Graph::m_entrypoints.size() is not equivalent to Graph::m_numberOfEntrypoints.
Graph::m_entrypoints is really just the CFG roots. In CPS, this vector has
size >= 1. In SSA, the size is always 1. This patch renames Graph::m_entrypoints
to Graph::m_roots. To be consistent, this patch also renames Graph's m_entrypointToArguments
field to m_rootToArguments.

Graph::m_numberOfEntrypoints retains its name. This field is only used in SSA
when compiling with EntrySwitch. It represents the logical number of entrypoints
the compilation will end up with. Each EntrySwitch has m_numberOfEntrypoints
cases.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::parseCodeBlock):

  • dfg/DFGCFG.h:

(JSC::DFG::CFG::roots):
(JSC::DFG::CPSCFG::CPSCFG):

  • dfg/DFGCPSRethreadingPhase.cpp:

(JSC::DFG::CPSRethreadingPhase::specialCaseArguments):

  • dfg/DFGDCEPhase.cpp:

(JSC::DFG::DCEPhase::run):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::determineReachability):
(JSC::DFG::Graph::blocksInPreOrder):
(JSC::DFG::Graph::blocksInPostOrder):
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::isRoot):
(JSC::DFG::Graph::isEntrypoint): Deleted.

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::initialize):

  • dfg/DFGLoopPreHeaderCreationPhase.cpp:

(JSC::DFG::createPreHeader):

  • dfg/DFGMaximalFlushInsertionPhase.cpp:

(JSC::DFG::MaximalFlushInsertionPhase::run):
(JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):

  • dfg/DFGOSREntrypointCreationPhase.cpp:

(JSC::DFG::OSREntrypointCreationPhase::run):

  • dfg/DFGPredictionInjectionPhase.cpp:

(JSC::DFG::PredictionInjectionPhase::run):

  • dfg/DFGSSAConversionPhase.cpp:

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

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
(JSC::DFG::SpeculativeJIT::linkOSREntries):

  • dfg/DFGTypeCheckHoistingPhase.cpp:

(JSC::DFG::TypeCheckHoistingPhase::run):

  • dfg/DFGValidate.cpp:
File:
1 edited

Legend:

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

    r221602 r221637  
    114114        origin = target->at(0)->origin;
    115115       
    116         ArgumentsVector newArguments = m_graph.m_entrypointToArguments.find(m_graph.block(0))->value;
     116        ArgumentsVector newArguments = m_graph.m_rootToArguments.find(m_graph.block(0))->value;
    117117        for (int argument = 0; argument < baseline->numParameters(); ++argument) {
    118118            Node* oldNode = target->variablesAtHead.argument(argument);
     
    143143        insertionSet.execute();
    144144
    145         RELEASE_ASSERT(m_graph.m_entrypoints.size() == 1);
    146         m_graph.m_entrypoints[0] = newRoot;
    147         m_graph.m_entrypointToArguments.clear();
    148         m_graph.m_entrypointToArguments.add(newRoot, newArguments);
     145        RELEASE_ASSERT(m_graph.m_roots.size() == 1);
     146        m_graph.m_roots[0] = newRoot;
     147        m_graph.m_rootToArguments.clear();
     148        m_graph.m_rootToArguments.add(newRoot, newArguments);
    149149
    150150        m_graph.invalidateCFG();
Note: See TracChangeset for help on using the changeset viewer.