Bug 1068725: More debugging and assertions for MoveGroups; r=sunfish

* * *
Bug 1068725: Make the MoveGroup type spew debug only; r=bustage
This commit is contained in:
Benjamin Bouvier 2014-09-30 11:33:11 +02:00
parent 44240be360
commit eb393525a6
3 changed files with 27 additions and 4 deletions

View File

@ -348,6 +348,8 @@ static const char * const TypeChars[] =
"s", // SLOTS
"f", // FLOAT32
"d", // DOUBLE
"i32x4", // INT32X4
"f32x4", // FLOAT32X4
#ifdef JS_NUNBOX32
"t", // TYPE
"p" // PAYLOAD
@ -541,9 +543,25 @@ bool
LMoveGroup::add(LAllocation *from, LAllocation *to, LDefinition::Type type)
{
#ifdef DEBUG
JS_ASSERT(*from != *to);
MOZ_ASSERT(*from != *to);
for (size_t i = 0; i < moves_.length(); i++)
JS_ASSERT(*to != *moves_[i].to());
MOZ_ASSERT(*to != *moves_[i].to());
// Check that SIMD moves are aligned according to ABI requirements.
if (LDefinition(type).isSimdType()) {
if (from->isMemory()) {
if (from->isArgument())
MOZ_ASSERT(from->toArgument()->index() % SimdStackAlignment == 0);
else
MOZ_ASSERT(from->toStackSlot()->slot() % SimdStackAlignment == 0);
}
if (to->isMemory()) {
if (to->isArgument())
MOZ_ASSERT(to->toArgument()->index() % SimdStackAlignment == 0);
else
MOZ_ASSERT(to->toStackSlot()->slot() % SimdStackAlignment == 0);
}
}
#endif
return moves_.append(LMove(from, to, type));
}
@ -582,7 +600,11 @@ LMoveGroup::printOperands(FILE *fp)
const LMove &move = getMove(i);
// Use two printfs, as LAllocation::toString is not reentrant.
fprintf(fp, " [%s", move.from()->toString());
fprintf(fp, " -> %s]", move.to()->toString());
fprintf(fp, " -> %s", move.to()->toString());
#ifdef DEBUG
fprintf(fp, ", %s", TypeChars[move.type()]);
#endif
fprintf(fp, "]");
if (i != numMoves() - 1)
fprintf(fp, ",");
}

View File

@ -416,6 +416,7 @@ class LDefinition
MUST_REUSE_INPUT
};
// This should be kept in sync with LIR.cpp's TypeChars.
enum Type {
GENERAL, // Generic, integer or pointer-width data (GPR).
INT32, // int32 data (GPR).

View File

@ -407,7 +407,7 @@ AllocationIntegrityState::dump()
if (ins->isMoveGroup()) {
LMoveGroup *group = ins->toMoveGroup();
for (int i = group->numMoves() - 1; i >= 0; i--) {
// Use two printfs, as LAllocation::toString is not reentant.
// Use two printfs, as LAllocation::toString is not reentrant.
fprintf(stderr, " [%s", group->getMove(i).from()->toString());
fprintf(stderr, " -> %s]", group->getMove(i).to()->toString());
}