Bug 1042729 part 5 - Only list resume points in debug builds. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2014-08-21 20:47:04 +02:00
parent 462f7346d1
commit 303886e84b
3 changed files with 20 additions and 2 deletions

View File

@ -10774,7 +10774,11 @@ class MNewDenseArrayPar : public MBinaryInstruction
// A resume point contains the information needed to reconstruct the Baseline
// state from a position in the JIT. See the big comment near resumeAfter() in
// IonBuilder.cpp.
class MResumePoint MOZ_FINAL : public MNode, public InlineForwardListNode<MResumePoint>
class MResumePoint MOZ_FINAL :
public MNode
#ifdef DEBUG
, public InlineForwardListNode<MResumePoint>
#endif
{
public:
enum Mode {

View File

@ -773,6 +773,7 @@ MBasicBlock::discardResumePoint(MResumePoint *rp, ReferencesType refType /* = Re
{
if (refType & RefType_DiscardOperands)
rp->discardUses();
#ifdef DEBUG
MResumePointIterator iter = resumePointsBegin();
while (*iter != rp) {
// We should reach it before reaching the end.
@ -780,6 +781,7 @@ MBasicBlock::discardResumePoint(MResumePoint *rp, ReferencesType refType /* = Re
iter++;
}
resumePoints_.removeAt(iter);
#endif
}
void

View File

@ -27,7 +27,10 @@ class MDefinitionIterator;
typedef InlineListIterator<MInstruction> MInstructionIterator;
typedef InlineListReverseIterator<MInstruction> MInstructionReverseIterator;
typedef InlineListIterator<MPhi> MPhiIterator;
#ifdef DEBUG
typedef InlineForwardListIterator<MResumePoint> MResumePointIterator;
#endif
class LBlock;
@ -183,7 +186,9 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
// Adds a resume point to this block.
void addResumePoint(MResumePoint *resume) {
#ifdef DEBUG
resumePoints_.pushFront(resume);
#endif
}
// Discard pre-allocated resume point.
@ -341,6 +346,7 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
bool phisEmpty() const {
return phis_.empty();
}
#ifdef DEBUG
MResumePointIterator resumePointsBegin() const {
return resumePoints_.begin();
}
@ -350,6 +356,7 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
bool resumePointsEmpty() const {
return resumePoints_.empty();
}
#endif
MInstructionIterator begin() {
return instructions_.begin();
}
@ -565,7 +572,6 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
InlineList<MInstruction> instructions_;
Vector<MBasicBlock *, 1, IonAllocPolicy> predecessors_;
InlineList<MPhi> phis_;
InlineForwardList<MResumePoint> resumePoints_;
FixedList<MDefinition *> slots_;
uint32_t stackPosition_;
uint32_t id_;
@ -582,6 +588,12 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
// beginning of the call-site which is being inlined after this block.
MResumePoint *outerResumePoint_;
#ifdef DEBUG
// Unordered list used to verify that all the resume points which are
// registered are correctly removed when a basic block is removed.
InlineForwardList<MResumePoint> resumePoints_;
#endif
MBasicBlock *successorWithPhis_;
uint32_t positionInPhiSuccessor_;
uint32_t loopDepth_;