mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
Bug 1042729 part 4 - Keep a reference to outer resume point on basic blocks, and make discarding resume point precise. r=jandem
This commit is contained in:
parent
cb81a8d124
commit
04f631b40e
@ -1784,7 +1784,14 @@ jit::AssertBasicGraphCoherency(MIRGraph &graph)
|
|||||||
for (size_t i = 0; i < block->numPredecessors(); i++)
|
for (size_t i = 0; i < block->numPredecessors(); i++)
|
||||||
JS_ASSERT(CheckPredecessorImpliesSuccessor(*block, block->getPredecessor(i)));
|
JS_ASSERT(CheckPredecessorImpliesSuccessor(*block, block->getPredecessor(i)));
|
||||||
|
|
||||||
MOZ_ASSERT_IF(block->entryResumePoint(), !block->entryResumePoint()->instruction());
|
if (block->entryResumePoint()) {
|
||||||
|
MOZ_ASSERT(!block->entryResumePoint()->instruction());
|
||||||
|
MOZ_ASSERT(block->entryResumePoint()->block() == *block);
|
||||||
|
}
|
||||||
|
if (block->outerResumePoint()) {
|
||||||
|
MOZ_ASSERT(!block->outerResumePoint()->instruction());
|
||||||
|
MOZ_ASSERT(block->outerResumePoint()->block() == *block);
|
||||||
|
}
|
||||||
for (MResumePointIterator iter(block->resumePointsBegin()); iter != block->resumePointsEnd(); iter++) {
|
for (MResumePointIterator iter(block->resumePointsBegin()); iter != block->resumePointsEnd(); iter++) {
|
||||||
// We cannot yet assert that is there is no instruction then this is
|
// We cannot yet assert that is there is no instruction then this is
|
||||||
// the entry resume point because we are still storing resume points
|
// the entry resume point because we are still storing resume points
|
||||||
|
@ -3991,6 +3991,7 @@ IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target)
|
|||||||
MResumePoint::New(alloc(), current, pc, callerResumePoint_, MResumePoint::Outer);
|
MResumePoint::New(alloc(), current, pc, callerResumePoint_, MResumePoint::Outer);
|
||||||
if (!outerResumePoint)
|
if (!outerResumePoint)
|
||||||
return false;
|
return false;
|
||||||
|
current->setOuterResumePoint(outerResumePoint);
|
||||||
|
|
||||||
// Pop formals again, except leave |fun| on stack for duration of call.
|
// Pop formals again, except leave |fun| on stack for duration of call.
|
||||||
callInfo.popFormals(current);
|
callInfo.popFormals(current);
|
||||||
|
@ -150,8 +150,8 @@ MIRGraph::removeBlock(MBasicBlock *block)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
block->discardAllResumePoints();
|
|
||||||
block->discardAllInstructions();
|
block->discardAllInstructions();
|
||||||
|
block->discardAllResumePoints();
|
||||||
|
|
||||||
// Note: phis are disconnected from the rest of the graph, but are not
|
// Note: phis are disconnected from the rest of the graph, but are not
|
||||||
// removed entirely. If the block being removed is a loop header then
|
// removed entirely. If the block being removed is a loop header then
|
||||||
@ -342,6 +342,7 @@ MBasicBlock::MBasicBlock(MIRGraph &graph, CompileInfo &info, const BytecodeSite
|
|||||||
pc_(site.pc()),
|
pc_(site.pc()),
|
||||||
lir_(nullptr),
|
lir_(nullptr),
|
||||||
entryResumePoint_(nullptr),
|
entryResumePoint_(nullptr),
|
||||||
|
outerResumePoint_(nullptr),
|
||||||
successorWithPhis_(nullptr),
|
successorWithPhis_(nullptr),
|
||||||
positionInPhiSuccessor_(0),
|
positionInPhiSuccessor_(0),
|
||||||
loopDepth_(0),
|
loopDepth_(0),
|
||||||
@ -861,11 +862,10 @@ void
|
|||||||
MBasicBlock::discardAllInstructionsStartingAt(MInstructionIterator &iter)
|
MBasicBlock::discardAllInstructionsStartingAt(MInstructionIterator &iter)
|
||||||
{
|
{
|
||||||
while (iter != end()) {
|
while (iter != end()) {
|
||||||
// We only discard operands and flag the instruction as discarded as the
|
// Discard operands and resume point operands and flag the instruction
|
||||||
// resume points are exepected to be removed separately. Also we do not
|
// as discarded. Also we do not assert that we have no uses as blocks
|
||||||
// assert that we have no uses as block might be removed in reverse post
|
// might be removed in reverse post order.
|
||||||
// order.
|
prepareForDiscard(*iter, RefType_DefaultNoAssert);
|
||||||
prepareForDiscard(*iter, RefType_DiscardOperands);
|
|
||||||
iter = instructions_.removeAt(iter);
|
iter = instructions_.removeAt(iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -890,17 +890,24 @@ MBasicBlock::discardAllPhis()
|
|||||||
void
|
void
|
||||||
MBasicBlock::discardAllResumePoints(bool discardEntry)
|
MBasicBlock::discardAllResumePoints(bool discardEntry)
|
||||||
{
|
{
|
||||||
for (MResumePointIterator iter = resumePointsBegin(); iter != resumePointsEnd(); ) {
|
if (outerResumePoint_) {
|
||||||
MResumePoint *rp = *iter;
|
discardResumePoint(outerResumePoint_);
|
||||||
if (rp == entryResumePoint() && !discardEntry) {
|
outerResumePoint_ = nullptr;
|
||||||
iter++;
|
|
||||||
} else {
|
|
||||||
rp->discardUses();
|
|
||||||
iter = resumePoints_.removeAt(iter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (discardEntry)
|
|
||||||
|
if (discardEntry && entryResumePoint_)
|
||||||
clearEntryResumePoint();
|
clearEntryResumePoint();
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (!entryResumePoint()) {
|
||||||
|
MOZ_ASSERT(resumePointsEmpty());
|
||||||
|
} else {
|
||||||
|
MResumePointIterator iter(resumePointsBegin());
|
||||||
|
MOZ_ASSERT(iter != resumePointsEnd());
|
||||||
|
iter++;
|
||||||
|
MOZ_ASSERT(iter == resumePointsEnd());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -481,8 +481,16 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
|
|||||||
entryResumePoint_ = rp;
|
entryResumePoint_ = rp;
|
||||||
}
|
}
|
||||||
void clearEntryResumePoint() {
|
void clearEntryResumePoint() {
|
||||||
|
discardResumePoint(entryResumePoint_);
|
||||||
entryResumePoint_ = nullptr;
|
entryResumePoint_ = nullptr;
|
||||||
}
|
}
|
||||||
|
MResumePoint *outerResumePoint() const {
|
||||||
|
return outerResumePoint_;
|
||||||
|
}
|
||||||
|
void setOuterResumePoint(MResumePoint *outer) {
|
||||||
|
MOZ_ASSERT(!outerResumePoint_);
|
||||||
|
outerResumePoint_ = outer;
|
||||||
|
}
|
||||||
MResumePoint *callerResumePoint() {
|
MResumePoint *callerResumePoint() {
|
||||||
return entryResumePoint() ? entryResumePoint()->caller() : nullptr;
|
return entryResumePoint() ? entryResumePoint()->caller() : nullptr;
|
||||||
}
|
}
|
||||||
@ -565,7 +573,15 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
|
|||||||
uint32_t numDominated_;
|
uint32_t numDominated_;
|
||||||
jsbytecode *pc_;
|
jsbytecode *pc_;
|
||||||
LBlock *lir_;
|
LBlock *lir_;
|
||||||
|
|
||||||
|
// Resume point holding baseline-like frame for the PC corresponding to the
|
||||||
|
// entry of this basic block.
|
||||||
MResumePoint *entryResumePoint_;
|
MResumePoint *entryResumePoint_;
|
||||||
|
|
||||||
|
// Resume point holding baseline-like frame for the PC corresponding to the
|
||||||
|
// beginning of the call-site which is being inlined after this block.
|
||||||
|
MResumePoint *outerResumePoint_;
|
||||||
|
|
||||||
MBasicBlock *successorWithPhis_;
|
MBasicBlock *successorWithPhis_;
|
||||||
uint32_t positionInPhiSuccessor_;
|
uint32_t positionInPhiSuccessor_;
|
||||||
uint32_t loopDepth_;
|
uint32_t loopDepth_;
|
||||||
|
Loading…
Reference in New Issue
Block a user