diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 855803014146..740dd7f824f8 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -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 diff --git a/js/src/jit/BacktrackingAllocator.h b/js/src/jit/BacktrackingAllocator.h index 1b1cb39ad0c6..7dc05e96c98f 100644 --- a/js/src/jit/BacktrackingAllocator.h +++ b/js/src/jit/BacktrackingAllocator.h @@ -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()); diff --git a/js/src/jit/C1Spewer.cpp b/js/src/jit/C1Spewer.cpp index 850bb7b3116f..38a5e712f309 100644 --- a/js/src/jit/C1Spewer.cpp +++ b/js/src/jit/C1Spewer.cpp @@ -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"); } } diff --git a/js/src/jit/JSONSpewer.cpp b/js/src/jit/JSONSpewer.cpp index 9492f040d5b6..91e97007cbba 100644 --- a/js/src/jit/JSONSpewer.cpp +++ b/js/src/jit/JSONSpewer.cpp @@ -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(); } diff --git a/js/src/jit/LinearScan.cpp b/js/src/jit/LinearScan.cpp index 918ba91c144f..dc156c970165 100644 --- a/js/src/jit/LinearScan.cpp +++ b/js/src/jit/LinearScan.cpp @@ -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()); } } } diff --git a/js/src/jit/LiveRangeAllocator.cpp b/js/src/jit/LiveRangeAllocator.cpp index f1d1ebad427d..f77f18d9f933 100644 --- a/js/src/jit/LiveRangeAllocator.cpp +++ b/js/src/jit/LiveRangeAllocator.cpp @@ -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; } diff --git a/js/src/jit/RegisterAllocator.cpp b/js/src/jit/RegisterAllocator.cpp index e22476dceee5..962e63855ab4 100644 --- a/js/src/jit/RegisterAllocator.cpp +++ b/js/src/jit/RegisterAllocator.cpp @@ -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()) { diff --git a/js/src/jit/RegisterAllocator.h b/js/src/jit/RegisterAllocator.h index a22b9ecf4b3a..07d765cd752d 100644 --- a/js/src/jit/RegisterAllocator.h +++ b/js/src/jit/RegisterAllocator.h @@ -170,7 +170,7 @@ class CodePosition return bits_ >> INSTRUCTION_SHIFT; } - uint32_t pos() const { + uint32_t bits() const { return bits_; }