Bug 1027897 - IonMonkey: Rename CodePosition::pos() to avoid awkwardness like pos.pos() r=bhackett

This commit is contained in:
Dan Gohman 2014-06-23 13:42:08 -07:00
parent 8a69102407
commit 01de87666c
8 changed files with 32 additions and 32 deletions

View File

@ -677,7 +677,7 @@ BacktrackingAllocator::setIntervalRequirement(LiveInterval *interval)
if (IonSpewEnabled(IonSpew_RegAlloc)) {
IonSpew(IonSpew_RegAlloc, " Requirement %s, due to use at %u",
required.name(), iter->pos.pos());
required.name(), iter->pos.bits());
}
// If there are multiple fixed registers which the interval is
@ -1579,7 +1579,7 @@ BacktrackingAllocator::trySplitAfterLastRegisterUse(LiveInterval *interval, Live
}
// Can't trim non-register uses off the end by splitting.
if (!lastRegisterFrom.pos()) {
if (!lastRegisterFrom.bits()) {
IonSpew(IonSpew_RegAlloc, " interval has no register uses");
return true;
}
@ -1589,7 +1589,7 @@ BacktrackingAllocator::trySplitAfterLastRegisterUse(LiveInterval *interval, Live
}
IonSpew(IonSpew_RegAlloc, " split after last register use at %u",
lastRegisterTo.pos());
lastRegisterTo.bits());
SplitPositions splitPositions;
if (!splitPositions.append(lastRegisterTo))
@ -1724,7 +1724,7 @@ BacktrackingAllocator::splitAt(LiveInterval *interval, const SplitPositions &spl
newIntervals.back()->addUseAtEnd(new(alloc()) UsePosition(iter->use, iter->pos));
splitIter.advancePast(iter->pos);
} else if (isRegisterUse(iter->use, ins)) {
if (lastRegisterUse.pos() == 0 ||
if (lastRegisterUse.bits() == 0 ||
splitIter.isBeyondNextSplit(iter->pos))
{
// Place this register use into a different interval from the

View File

@ -89,7 +89,7 @@ class BacktrackingVirtualRegister : public VirtualRegister
canonicalSpillExclude_ = pos;
}
bool hasCanonicalSpillExclude() const {
return canonicalSpillExclude_.pos() != 0;
return canonicalSpillExclude_.bits() != 0;
}
CodePosition canonicalSpillExclude() const {
JS_ASSERT(hasCanonicalSpillExclude());

View File

@ -123,11 +123,11 @@ C1Spewer::spewIntervals(FILE *fp, LinearScanAllocator *regalloc, LInstruction *i
fprintf(fp, "%s", live->getAllocation()->toString());
fprintf(fp, "\" %d -1", id);
for (size_t j = 0; j < live->numRanges(); j++) {
fprintf(fp, " [%d, %d[", live->getRange(j)->from.pos(),
live->getRange(j)->to.pos());
fprintf(fp, " [%u, %u[", live->getRange(j)->from.bits(),
live->getRange(j)->to.bits());
}
for (UsePositionIterator usePos(live->usesBegin()); usePos != live->usesEnd(); usePos++)
fprintf(fp, " %d M", usePos->pos.pos());
fprintf(fp, " %u M", usePos->pos.bits());
fprintf(fp, " \"\"\n");
}
}

View File

@ -423,8 +423,8 @@ JSONSpewer::spewIntervals(LinearScanAllocator *regalloc)
for (size_t j = 0; j < live->numRanges(); j++) {
beginObject();
integerProperty("start", live->getRange(j)->from.pos());
integerProperty("end", live->getRange(j)->to.pos());
integerProperty("start", live->getRange(j)->from.bits());
integerProperty("end", live->getRange(j)->to.bits());
endObject();
}

View File

@ -95,8 +95,8 @@ LinearScanAllocator::allocateRegisters()
const Requirement *hint = current->hint();
IonSpew(IonSpew_RegAlloc, "Processing %d = [%u, %u] (pri=%d)",
current->hasVreg() ? current->vreg() : 0, current->start().pos(),
current->end().pos(), current->requirement()->priority());
current->hasVreg() ? current->vreg() : 0, current->start().bits(),
current->end().bits(), current->requirement()->priority());
// Shift active intervals to the inactive or handled sets as appropriate
if (position != prevPosition) {
@ -668,9 +668,9 @@ LinearScanAllocator::splitInterval(LiveInterval *interval, CodePosition pos)
return false;
IonSpew(IonSpew_RegAlloc, " Split interval to %u = [%u, %u]/[%u, %u]",
interval->vreg(), interval->start().pos(),
interval->end().pos(), newInterval->start().pos(),
newInterval->end().pos());
interval->vreg(), interval->start().bits(),
interval->end().bits(), newInterval->start().bits(),
newInterval->end().bits());
// We always want to enqueue the resulting split. We always split
// forward, and we never want to handle something forward of our
@ -706,7 +706,7 @@ LinearScanAllocator::splitBlockingIntervals(LAllocation allocation)
for (IntervalIterator i(active.begin()); i != active.end(); i++) {
if (i->getAllocation()->isRegister() && *i->getAllocation() == allocation) {
IonSpew(IonSpew_RegAlloc, " Splitting active interval %u = [%u, %u]",
vregs[i->vreg()].ins()->id(), i->start().pos(), i->end().pos());
vregs[i->vreg()].ins()->id(), i->start().bits(), i->end().bits());
JS_ASSERT(i->start() != current->start());
JS_ASSERT(i->covers(current->start()));
@ -726,7 +726,7 @@ LinearScanAllocator::splitBlockingIntervals(LAllocation allocation)
for (IntervalIterator i(inactive.begin()); i != inactive.end(); ) {
if (i->getAllocation()->isRegister() && *i->getAllocation() == allocation) {
IonSpew(IonSpew_RegAlloc, " Splitting inactive interval %u = [%u, %u]",
vregs[i->vreg()].ins()->id(), i->start().pos(), i->end().pos());
vregs[i->vreg()].ins()->id(), i->start().bits(), i->end().bits());
LiveInterval *it = *i;
CodePosition nextActive = it->nextCoveredAfter(current->start());
@ -995,7 +995,7 @@ LinearScanAllocator::findBestFreeRegister(CodePosition *freeUntil)
CodePosition pos = current->intersect(*i);
if (pos != CodePosition::MIN && pos < freeUntilPos[reg.code()]) {
freeUntilPos[reg.code()] = pos;
IonSpew(IonSpew_RegAlloc, " Register %s free until %u", reg.name(), pos.pos());
IonSpew(IonSpew_RegAlloc, " Register %s free until %u", reg.name(), pos.bits());
}
}
}
@ -1008,7 +1008,7 @@ LinearScanAllocator::findBestFreeRegister(CodePosition *freeUntil)
CodePosition pos = current->intersect(*i);
if (pos != CodePosition::MIN && pos < freeUntilPos[reg.code()]) {
freeUntilPos[reg.code()] = (pos == current->start()) ? CodePosition::MIN : pos;
IonSpew(IonSpew_RegAlloc, " Register %s free until %u", reg.name(), pos.pos());
IonSpew(IonSpew_RegAlloc, " Register %s free until %u", reg.name(), pos.bits());
}
}
}
@ -1085,7 +1085,7 @@ LinearScanAllocator::findBestBlockedRegister(CodePosition *nextUsed)
} else if (nextUsePos[reg.code()] != CodePosition::MIN) {
nextUsePos[reg.code()] = i->nextUsePosAfter(current->start());
IonSpew(IonSpew_RegAlloc, " Register %s next used %u", reg.name(),
nextUsePos[reg.code()].pos());
nextUsePos[reg.code()].bits());
}
}
}
@ -1096,7 +1096,7 @@ LinearScanAllocator::findBestBlockedRegister(CodePosition *nextUsed)
CodePosition pos = i->nextUsePosAfter(current->start());
if (pos < nextUsePos[reg.code()]) {
nextUsePos[reg.code()] = pos;
IonSpew(IonSpew_RegAlloc, " Register %s next used %u", reg.name(), pos.pos());
IonSpew(IonSpew_RegAlloc, " Register %s next used %u", reg.name(), pos.bits());
}
}
}
@ -1109,7 +1109,7 @@ LinearScanAllocator::findBestBlockedRegister(CodePosition *nextUsed)
CodePosition pos = i->intersect(current);
if (pos != CodePosition::MIN && pos < nextUsePos[reg.code()]) {
nextUsePos[reg.code()] = (pos == current->start()) ? CodePosition::MIN : pos;
IonSpew(IonSpew_RegAlloc, " Register %s next used %u (fixed)", reg.name(), pos.pos());
IonSpew(IonSpew_RegAlloc, " Register %s next used %u (fixed)", reg.name(), pos.bits());
}
}
}

View File

@ -66,7 +66,7 @@ Requirement::toString() const
cursor += n;
if (pos() != CodePosition::MIN) {
n = JS_snprintf(cursor, end - cursor, "@%u", pos().pos());
n = JS_snprintf(cursor, end - cursor, "@%u", pos().bits());
if (n < 0)
return "???";
cursor += n;
@ -129,7 +129,7 @@ LiveInterval::Range::toString() const
char *cursor = buf;
char *end = cursor + sizeof(buf);
int n = JS_snprintf(cursor, end - cursor, "[%u,%u)", from.pos(), to.pos());
int n = JS_snprintf(cursor, end - cursor, "[%u,%u)", from.bits(), to.bits());
if (n < 0)
return " ???";
cursor += n;
@ -1082,7 +1082,7 @@ LiveInterval::toString() const
for (UsePositionIterator usePos(usesBegin()); usePos != usesEnd(); usePos++) {
n = JS_snprintf(cursor, end - cursor, " %s@%u",
usePos->use->toString(), usePos->pos.pos());
usePos->use->toString(), usePos->pos.bits());
if (n < 0) return "???";
cursor += n;
}

View File

@ -377,8 +377,8 @@ AllocationIntegrityState::dump()
CodePosition output(block->getPhi(block->numPhis() - 1)->id(), CodePosition::OUTPUT);
fprintf(stderr, "[%u,%u Phi] [def %s] ",
input.pos(),
output.pos(),
input.bits(),
output.bits(),
phi->getDef(0)->toString());
for (size_t j = 0; j < phi->numOperands(); j++)
fprintf(stderr, " [use %s]", info.inputs[j].toString());
@ -394,7 +394,7 @@ AllocationIntegrityState::dump()
fprintf(stderr, "[");
if (input != CodePosition::MIN)
fprintf(stderr, "%u,%u ", input.pos(), output.pos());
fprintf(stderr, "%u,%u ", input.bits(), output.bits());
fprintf(stderr, "%s]", ins->opName());
if (ins->isMoveGroup()) {
@ -532,8 +532,8 @@ RegisterAllocator::dumpInstructions()
LPhi *phi = block->getPhi(i);
fprintf(stderr, "[%u,%u Phi] [def %s]",
inputOf(phi).pos(),
outputOf(phi).pos(),
inputOf(phi).bits(),
outputOf(phi).bits(),
phi->getDef(0)->toString());
for (size_t j = 0; j < phi->numOperands(); j++)
fprintf(stderr, " [use %s]", phi->getOperand(j)->toString());
@ -545,7 +545,7 @@ RegisterAllocator::dumpInstructions()
fprintf(stderr, "[");
if (ins->id() != 0)
fprintf(stderr, "%u,%u ", inputOf(ins).pos(), outputOf(ins).pos());
fprintf(stderr, "%u,%u ", inputOf(ins).bits(), outputOf(ins).bits());
fprintf(stderr, "%s]", ins->opName());
if (ins->isMoveGroup()) {

View File

@ -170,7 +170,7 @@ class CodePosition
return bits_ >> INSTRUCTION_SHIFT;
}
uint32_t pos() const {
uint32_t bits() const {
return bits_;
}