diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp')
| -rw-r--r-- | Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp b/Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp index 340ef2d18..507e00ff5 100644 --- a/Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp +++ b/Source/JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp @@ -32,17 +32,16 @@ #include "DFGBlockInsertionSet.h" #include "DFGGraph.h" #include "DFGPhase.h" -#include "JSCInlines.h" +#include "Operations.h" #include <wtf/HashMap.h> namespace JSC { namespace DFG { BasicBlock* createPreHeader(Graph& graph, BlockInsertionSet& insertionSet, BasicBlock* block) { - // Don't bother to preserve execution frequencies for now. - BasicBlock* preHeader = insertionSet.insertBefore(block, PNaN); + BasicBlock* preHeader = insertionSet.insertBefore(block); preHeader->appendNode( - graph, SpecNone, Jump, block->firstOrigin(), OpInfo(block)); + graph, SpecNone, Jump, block->at(0)->codeOrigin, OpInfo(block)); for (unsigned predecessorIndex = 0; predecessorIndex < block->predecessors.size(); predecessorIndex++) { BasicBlock* predecessor = block->predecessors[predecessorIndex]; @@ -88,23 +87,11 @@ public: existingPreHeader = predecessor; continue; } - // We won't have duplicate entries in the predecessors list. - DFG_ASSERT(m_graph, nullptr, existingPreHeader != predecessor); + if (existingPreHeader == predecessor) + continue; needsNewPreHeader = true; break; } - - // This phase should only be run on a DFG where unreachable blocks have been pruned. - // We also don't allow loops back to root. This means that every loop header has got - // to have a pre-header. - DFG_ASSERT(m_graph, nullptr, existingPreHeader); - - // We are looking at the predecessors of a loop header. A loop header has to have - // some predecessor other than the pre-header. We must have broken critical edges - // because that is the DFG SSA convention. Therefore, each predecessor of the loop - // header must have only one successor. - DFG_ASSERT(m_graph, nullptr, existingPreHeader->terminal()->op() == Jump); - if (!needsNewPreHeader) continue; |
