зеркало из https://github.com/mozilla/gecko-dev.git
Bug 949171 - SpiderMonkey: Tighten up various assertions. r=nbp
This commit is contained in:
Родитель
bf65a5665c
Коммит
9f4e4d2fef
|
@ -835,6 +835,7 @@ BacktrackingAllocator::spill(LiveInterval *interval)
|
||||||
IonSpew(IonSpew_RegAlloc, "Spilling interval");
|
IonSpew(IonSpew_RegAlloc, "Spilling interval");
|
||||||
|
|
||||||
JS_ASSERT(interval->requirement()->kind() == Requirement::NONE);
|
JS_ASSERT(interval->requirement()->kind() == Requirement::NONE);
|
||||||
|
JS_ASSERT(!interval->getAllocation()->isStackSlot());
|
||||||
|
|
||||||
// We can't spill bogus intervals.
|
// We can't spill bogus intervals.
|
||||||
JS_ASSERT(interval->hasVreg());
|
JS_ASSERT(interval->hasVreg());
|
||||||
|
|
|
@ -58,7 +58,7 @@ class BitSet : private TempObject
|
||||||
// O(1): Check if this set contains the given value.
|
// O(1): Check if this set contains the given value.
|
||||||
bool contains(unsigned int value) const {
|
bool contains(unsigned int value) const {
|
||||||
JS_ASSERT(bits_);
|
JS_ASSERT(bits_);
|
||||||
JS_ASSERT(value <= max_);
|
JS_ASSERT(value < max_);
|
||||||
|
|
||||||
return !!(bits_[wordForValue(value)] & bitForValue(value));
|
return !!(bits_[wordForValue(value)] & bitForValue(value));
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class BitSet : private TempObject
|
||||||
// O(1): Insert the given value into this set.
|
// O(1): Insert the given value into this set.
|
||||||
void insert(unsigned int value) {
|
void insert(unsigned int value) {
|
||||||
JS_ASSERT(bits_);
|
JS_ASSERT(bits_);
|
||||||
JS_ASSERT(value <= max_);
|
JS_ASSERT(value < max_);
|
||||||
|
|
||||||
bits_[wordForValue(value)] |= bitForValue(value);
|
bits_[wordForValue(value)] |= bitForValue(value);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ class BitSet : private TempObject
|
||||||
// O(1): Remove the given value from this set.
|
// O(1): Remove the given value from this set.
|
||||||
void remove(unsigned int value) {
|
void remove(unsigned int value) {
|
||||||
JS_ASSERT(bits_);
|
JS_ASSERT(bits_);
|
||||||
JS_ASSERT(value <= max_);
|
JS_ASSERT(value < max_);
|
||||||
|
|
||||||
bits_[wordForValue(value)] &= ~bitForValue(value);
|
bits_[wordForValue(value)] &= ~bitForValue(value);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class BitSet::Iterator
|
||||||
|
|
||||||
inline Iterator& operator++(int dummy) {
|
inline Iterator& operator++(int dummy) {
|
||||||
JS_ASSERT(more());
|
JS_ASSERT(more());
|
||||||
JS_ASSERT(index_ <= set_.max_);
|
JS_ASSERT(index_ < set_.max_);
|
||||||
|
|
||||||
index_++;
|
index_++;
|
||||||
value_ >>= 1;
|
value_ >>= 1;
|
||||||
|
@ -158,12 +158,12 @@ class BitSet::Iterator
|
||||||
index_ += numZeros;
|
index_ += numZeros;
|
||||||
value_ >>= numZeros;
|
value_ >>= numZeros;
|
||||||
|
|
||||||
JS_ASSERT_IF(index_ <= set_.max_, set_.contains(index_));
|
JS_ASSERT_IF(index_ < set_.max_, set_.contains(index_));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int operator *() {
|
unsigned int operator *() {
|
||||||
JS_ASSERT(index_ <= set_.max_);
|
JS_ASSERT(index_ < set_.max_);
|
||||||
return index_;
|
return index_;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1139,6 +1139,7 @@ CodeGenerator::visitStackArgT(LStackArgT *lir)
|
||||||
const LAllocation *arg = lir->getArgument();
|
const LAllocation *arg = lir->getArgument();
|
||||||
MIRType argType = lir->mir()->getArgument()->type();
|
MIRType argType = lir->mir()->getArgument()->type();
|
||||||
uint32_t argslot = lir->argslot();
|
uint32_t argslot = lir->argslot();
|
||||||
|
JS_ASSERT(argslot - 1u < graph.argumentSlotCount());
|
||||||
|
|
||||||
int32_t stack_offset = StackOffsetOfPassedArg(argslot);
|
int32_t stack_offset = StackOffsetOfPassedArg(argslot);
|
||||||
Address dest(StackPointer, stack_offset);
|
Address dest(StackPointer, stack_offset);
|
||||||
|
@ -1150,7 +1151,9 @@ CodeGenerator::visitStackArgT(LStackArgT *lir)
|
||||||
else
|
else
|
||||||
masm.storeValue(*(arg->toConstant()), dest);
|
masm.storeValue(*(arg->toConstant()), dest);
|
||||||
|
|
||||||
return pushedArgumentSlots_.append(StackOffsetToSlot(stack_offset));
|
uint32_t slot = StackOffsetToSlot(stack_offset);
|
||||||
|
JS_ASSERT(slot - 1u < graph.totalSlotCount());
|
||||||
|
return pushedArgumentSlots_.append(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -1158,10 +1161,15 @@ CodeGenerator::visitStackArgV(LStackArgV *lir)
|
||||||
{
|
{
|
||||||
ValueOperand val = ToValue(lir, 0);
|
ValueOperand val = ToValue(lir, 0);
|
||||||
uint32_t argslot = lir->argslot();
|
uint32_t argslot = lir->argslot();
|
||||||
|
JS_ASSERT(argslot - 1u < graph.argumentSlotCount());
|
||||||
|
|
||||||
int32_t stack_offset = StackOffsetOfPassedArg(argslot);
|
int32_t stack_offset = StackOffsetOfPassedArg(argslot);
|
||||||
|
|
||||||
masm.storeValue(val, Address(StackPointer, stack_offset));
|
masm.storeValue(val, Address(StackPointer, stack_offset));
|
||||||
return pushedArgumentSlots_.append(StackOffsetToSlot(stack_offset));
|
|
||||||
|
uint32_t slot = StackOffsetToSlot(stack_offset);
|
||||||
|
JS_ASSERT(slot - 1u < graph.totalSlotCount());
|
||||||
|
return pushedArgumentSlots_.append(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -73,8 +73,9 @@ LBlock::lastId()
|
||||||
{
|
{
|
||||||
LInstruction *last = *instructions_.rbegin();
|
LInstruction *last = *instructions_.rbegin();
|
||||||
JS_ASSERT(last->id());
|
JS_ASSERT(last->id());
|
||||||
if (last->numDefs())
|
// The last instruction is a control flow instruction which does not have
|
||||||
return last->getDef(last->numDefs() - 1)->virtualRegister();
|
// any output.
|
||||||
|
JS_ASSERT(last->numDefs() == 0);
|
||||||
return last->id();
|
return last->id();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,6 +305,7 @@ LIRGenerator::visitPassArg(MPassArg *arg)
|
||||||
{
|
{
|
||||||
MDefinition *opd = arg->getArgument();
|
MDefinition *opd = arg->getArgument();
|
||||||
uint32_t argslot = getArgumentSlot(arg->getArgnum());
|
uint32_t argslot = getArgumentSlot(arg->getArgnum());
|
||||||
|
JS_ASSERT(arg->getArgnum() < prepareCallStack_.back()->argc());
|
||||||
|
|
||||||
// Pass through the virtual register of the operand.
|
// Pass through the virtual register of the operand.
|
||||||
// This causes snapshots to correctly copy the operand on the stack.
|
// This causes snapshots to correctly copy the operand on the stack.
|
||||||
|
|
|
@ -2829,6 +2829,7 @@ class MPassArg
|
||||||
// Set by the MCall.
|
// Set by the MCall.
|
||||||
void setArgnum(uint32_t argnum) {
|
void setArgnum(uint32_t argnum) {
|
||||||
argnum_ = argnum;
|
argnum_ = argnum;
|
||||||
|
JS_ASSERT(argnum_ >= 0);
|
||||||
}
|
}
|
||||||
uint32_t getArgnum() const {
|
uint32_t getArgnum() const {
|
||||||
JS_ASSERT(argnum_ >= 0);
|
JS_ASSERT(argnum_ >= 0);
|
||||||
|
|
|
@ -763,6 +763,7 @@ MBasicBlock::discardAllResumePoints(bool discardEntry)
|
||||||
void
|
void
|
||||||
MBasicBlock::insertBefore(MInstruction *at, MInstruction *ins)
|
MBasicBlock::insertBefore(MInstruction *at, MInstruction *ins)
|
||||||
{
|
{
|
||||||
|
JS_ASSERT(at->block() == this);
|
||||||
ins->setBlock(this);
|
ins->setBlock(this);
|
||||||
graph().allocDefinitionId(ins);
|
graph().allocDefinitionId(ins);
|
||||||
instructions_.insertBefore(at, ins);
|
instructions_.insertBefore(at, ins);
|
||||||
|
@ -772,6 +773,7 @@ MBasicBlock::insertBefore(MInstruction *at, MInstruction *ins)
|
||||||
void
|
void
|
||||||
MBasicBlock::insertAfter(MInstruction *at, MInstruction *ins)
|
MBasicBlock::insertAfter(MInstruction *at, MInstruction *ins)
|
||||||
{
|
{
|
||||||
|
JS_ASSERT(at->block() == this);
|
||||||
ins->setBlock(this);
|
ins->setBlock(this);
|
||||||
graph().allocDefinitionId(ins);
|
graph().allocDefinitionId(ins);
|
||||||
instructions_.insertAfter(at, ins);
|
instructions_.insertAfter(at, ins);
|
||||||
|
|
|
@ -994,7 +994,7 @@ MPhi::computeRange(TempAllocator &alloc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Range *range = nullptr;
|
Range *range = nullptr;
|
||||||
JS_ASSERT(getOperand(0)->op() != MDefinition::Op_OsrValue);
|
JS_ASSERT(!isOSRLikeValue(getOperand(0)));
|
||||||
for (size_t i = 0, e = numOperands(); i < e; i++) {
|
for (size_t i = 0, e = numOperands(); i < e; i++) {
|
||||||
if (getOperand(i)->block()->unreachable()) {
|
if (getOperand(i)->block()->unreachable()) {
|
||||||
IonSpew(IonSpew_Range, "Ignoring unreachable input %d", getOperand(i)->id());
|
IonSpew(IonSpew_Range, "Ignoring unreachable input %d", getOperand(i)->id());
|
||||||
|
|
Загрузка…
Ссылка в новой задаче