From 3a3e49dc574135abf65a0a9a57a731efacee2bad Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 23 Jun 2014 13:42:06 -0700 Subject: [PATCH] Bug 1027897 - IonMonkey: Minor code simplifications. r=bhackett --- js/src/jit/BacktrackingAllocator.cpp | 2 +- js/src/jit/LinearScan.cpp | 2 +- js/src/jit/RegisterAllocator.cpp | 4 ++-- js/src/jit/StupidAllocator.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 346fbc9cfe8e..f0ec961b1149 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -963,7 +963,7 @@ BacktrackingAllocator::resolveControlFlow() LBlock *predecessor = mSuccessor->getPredecessor(k)->lir(); JS_ASSERT(predecessor->mir()->numSuccessors() == 1); - LAllocation *input = phi->getOperand(predecessor->mir()->positionInPhiSuccessor()); + LAllocation *input = phi->getOperand(k); LiveInterval *from = vregs[input].intervalFor(outputOf(predecessor->lastId())); JS_ASSERT(from); diff --git a/js/src/jit/LinearScan.cpp b/js/src/jit/LinearScan.cpp index 8d8ae78f4df7..60a6b5a711f7 100644 --- a/js/src/jit/LinearScan.cpp +++ b/js/src/jit/LinearScan.cpp @@ -242,7 +242,7 @@ LinearScanAllocator::resolveControlFlow() LBlock *predecessor = mSuccessor->getPredecessor(k)->lir(); JS_ASSERT(predecessor->mir()->numSuccessors() == 1); - LAllocation *input = phi->getOperand(predecessor->mir()->positionInPhiSuccessor()); + LAllocation *input = phi->getOperand(k); LiveInterval *from = vregs[input].intervalFor(outputOf(predecessor->lastId())); JS_ASSERT(from); diff --git a/js/src/jit/RegisterAllocator.cpp b/js/src/jit/RegisterAllocator.cpp index 4251ba333739..cabc5c05934a 100644 --- a/js/src/jit/RegisterAllocator.cpp +++ b/js/src/jit/RegisterAllocator.cpp @@ -234,7 +234,7 @@ AllocationIntegrityState::checkIntegrity(LBlock *block, LInstruction *ins, if (info.outputs[0].virtualRegister() == vreg) { for (size_t j = 0, jend = phi->numOperands(); j < jend; j++) { uint32_t newvreg = info.inputs[j].toUse()->virtualRegister(); - LBlock *predecessor = graph.getBlock(block->mir()->getPredecessor(j)->id()); + LBlock *predecessor = block->mir()->getPredecessor(j)->lir(); if (!addPredecessor(predecessor, newvreg, alloc)) return false; } @@ -245,7 +245,7 @@ AllocationIntegrityState::checkIntegrity(LBlock *block, LInstruction *ins, // No phi which defined the vreg we are tracking, follow back through all // predecessors with the existing vreg. for (size_t i = 0, iend = block->mir()->numPredecessors(); i < iend; i++) { - LBlock *predecessor = graph.getBlock(block->mir()->getPredecessor(i)->id()); + LBlock *predecessor = block->mir()->getPredecessor(i)->lir(); if (!addPredecessor(predecessor, vreg, alloc)) return false; } diff --git a/js/src/jit/StupidAllocator.cpp b/js/src/jit/StupidAllocator.cpp index 39e3ac644251..dc32cf1e25ea 100644 --- a/js/src/jit/StupidAllocator.cpp +++ b/js/src/jit/StupidAllocator.cpp @@ -282,7 +282,7 @@ StupidAllocator::syncForBlockEnd(LBlock *block, LInstruction *ins) MBasicBlock *successor = block->mir()->successorWithPhis(); if (successor) { uint32_t position = block->mir()->positionInPhiSuccessor(); - LBlock *lirsuccessor = graph.getBlock(successor->id()); + LBlock *lirsuccessor = successor->lir(); for (size_t i = 0; i < lirsuccessor->numPhis(); i++) { LPhi *phi = lirsuccessor->getPhi(i);