Bug 859255 - Fix stitching up of parallel bailout basic blocks. (r=dvander)

This commit is contained in:
Shu-yu Guo 2013-04-18 17:42:01 -07:00
parent fc7ff0437c
commit d9624c5899
3 changed files with 14 additions and 13 deletions

View File

@ -161,17 +161,21 @@ MBasicBlock::NewSplitEdge(MIRGraph &graph, CompileInfo &info, MBasicBlock *pred)
MBasicBlock *
MBasicBlock::NewParBailout(MIRGraph &graph, CompileInfo &info,
MBasicBlock *pred, jsbytecode *entryPc)
MBasicBlock *pred, jsbytecode *entryPc,
MResumePoint *resumePoint)
{
MBasicBlock *block = MBasicBlock::New(graph, info, pred, entryPc, NORMAL);
if (!block)
MBasicBlock *block = new MBasicBlock(graph, info, entryPc, NORMAL);
resumePoint->block_ = block;
block->entryResumePoint_ = resumePoint;
if (!block->init())
return NULL;
MParBailout *bailout = new MParBailout();
if (!bailout)
if (!block->addPredecessorWithoutPhis(pred))
return NULL;
block->end(bailout);
block->end(new MParBailout());
return block;
}

View File

@ -75,7 +75,8 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
MBasicBlock *pred, jsbytecode *entryPc);
static MBasicBlock *NewSplitEdge(MIRGraph &graph, CompileInfo &info, MBasicBlock *pred);
static MBasicBlock *NewParBailout(MIRGraph &graph, CompileInfo &info,
MBasicBlock *pred, jsbytecode *entryPc);
MBasicBlock *pred, jsbytecode *entryPc,
MResumePoint *resumePoint);
bool dominates(MBasicBlock *other);

View File

@ -508,11 +508,6 @@ ParallelArrayVisitor::convertToBailout(MBasicBlock *block, MInstruction *ins)
// This block is no longer reachable.
block->unmark();
// Determine the best PC to use for the bailouts we'll be creating.
jsbytecode *pc = block->pc();
if (!pc)
pc = block->pc();
// Create a bailout block for each predecessor. In principle, we
// only need one bailout block--in fact, only one per graph! But I
// found this approach easier to implement given the design of the
@ -528,7 +523,8 @@ ParallelArrayVisitor::convertToBailout(MBasicBlock *block, MInstruction *ins)
continue;
// create bailout block to insert on this edge
MBasicBlock *bailBlock = MBasicBlock::NewParBailout(graph_, pred->info(), pred, pc);
MBasicBlock *bailBlock = MBasicBlock::NewParBailout(graph_, block->info(), pred,
block->pc(), block->entryResumePoint());
if (!bailBlock)
return false;