Bug 1319888 - MBasicBlock::NewSplitEdge: use the successor info instead of the predecessor info. r=h4writer, a=lizzard
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -546,17 +546,17 @@ SplitCriticalEdgesForBlock(MIRGraph& gra
return true;
for (size_t i = 0; i < block->numSuccessors(); i++) {
MBasicBlock* target = block->getSuccessor(i);
if (target->numPredecessors() < 2)
continue;
// Create a simple new block which contains a goto and which split the
// edge between block and target.
- MBasicBlock* split = MBasicBlock::NewSplitEdge(graph, block->info(), block, i, target);
+ MBasicBlock* split = MBasicBlock::NewSplitEdge(graph, block, i, target);
if (!split)
return false;
}
return true;
}
// A critical edge is an edge which is neither its successor's only predecessor
// nor its predecessor's only successor. Critical edges must be split to
--- a/js/src/jit/MIRGraph.cpp
+++ b/js/src/jit/MIRGraph.cpp
@@ -270,30 +270,30 @@ MBasicBlock::NewPendingLoopHeader(MIRGra
if (!block->inherit(graph.alloc(), nullptr, pred, 0, stackPhiCount))
return nullptr;
return block;
}
MBasicBlock*
-MBasicBlock::NewSplitEdge(MIRGraph& graph, const CompileInfo& info, MBasicBlock* pred, size_t predEdgeIdx, MBasicBlock* succ)
+MBasicBlock::NewSplitEdge(MIRGraph& graph, MBasicBlock* pred, size_t predEdgeIdx, MBasicBlock* succ)
{
MBasicBlock* split = nullptr;
- if (!pred->pc()) {
+ if (!succ->pc()) {
// The predecessor does not have a PC, this is a Wasm compilation.
- split = MBasicBlock::New(graph, info, pred, SPLIT_EDGE);
+ split = MBasicBlock::New(graph, succ->info(), pred, SPLIT_EDGE);
if (!split)
return nullptr;
} else {
// The predecessor has a PC, this is an IonBuilder compilation.
MResumePoint* succEntry = succ->entryResumePoint();
BytecodeSite* site = new(graph.alloc()) BytecodeSite(succ->trackedTree(), succEntry->pc());
- split = new(graph.alloc()) MBasicBlock(graph, info, site, SPLIT_EDGE);
+ split = new(graph.alloc()) MBasicBlock(graph, succ->info(), site, SPLIT_EDGE);
if (!split->init())
return nullptr;
// A split edge is used to simplify the graph to avoid having a
// predecessor with multiple successors as well as a successor with
// multiple predecessors. As instructions can be moved in this
// split-edge block, we need to give this block a resume point. To do
--- a/js/src/jit/MIRGraph.h
+++ b/js/src/jit/MIRGraph.h
@@ -112,19 +112,18 @@ class MBasicBlock : public TempObject, p
static MBasicBlock* NewPopN(MIRGraph& graph, const CompileInfo& info,
MBasicBlock* pred, BytecodeSite* site, Kind kind, uint32_t popn);
static MBasicBlock* NewWithResumePoint(MIRGraph& graph, const CompileInfo& info,
MBasicBlock* pred, BytecodeSite* site,
MResumePoint* resumePoint);
static MBasicBlock* NewPendingLoopHeader(MIRGraph& graph, const CompileInfo& info,
MBasicBlock* pred, BytecodeSite* site,
unsigned loopStateSlots);
- static MBasicBlock* NewSplitEdge(MIRGraph& graph, const CompileInfo& info,
- MBasicBlock* pred, size_t predEdgeIdx,
- MBasicBlock* succ);
+ static MBasicBlock* NewSplitEdge(MIRGraph& graph, MBasicBlock* pred,
+ size_t predEdgeIdx, MBasicBlock* succ);
bool dominates(const MBasicBlock* other) const {
return other->domIndex() - domIndex() < numDominated();
}
void setId(uint32_t id) {
id_ = id;
}