Index: runtime/vm/flow_graph_compiler.cc |
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc |
index b0004ca4ce8b5191ecb4bcc60099b232c7a09055..433d91ae94a656f2642f0011dcfeaf35e740c04a 100644 |
--- a/runtime/vm/flow_graph_compiler.cc |
+++ b/runtime/vm/flow_graph_compiler.cc |
@@ -1260,16 +1260,6 @@ static uword RegMaskBit(Register reg) { |
} |
-// Mask of globally reserved registers. Some other registers are only reserved |
-// in particular code (e.g., ARGS_DESC_REG in intrinsics). |
-static const uword kReservedCpuRegisters = RegMaskBit(SPREG) |
- | RegMaskBit(FPREG) |
- | RegMaskBit(TMP) |
- | RegMaskBit(TMP2) |
- | RegMaskBit(PP) |
- | RegMaskBit(THR); |
- |
- |
void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) { |
ASSERT(!is_optimizing()); |
@@ -1279,16 +1269,10 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) { |
bool blocked_registers[kNumberOfCpuRegisters]; |
- // Mark all available registers free. |
- for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) { |
- blocked_registers[i] = false; |
- } |
- |
- // Block all registers globally reserved by the assembler, etc. |
+ // Block all registers globally reserved by the assembler, etc and mark |
+ // the rest as free. |
for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) { |
- if ((kReservedCpuRegisters & (1 << i)) != 0) { |
- blocked_registers[i] = true; |
- } |
+ blocked_registers[i] = (kDartAvailableCpuRegs & (1 << i)) == 0; |
} |
// Mark all fixed input, temp and output registers as used. |
@@ -1316,14 +1300,6 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) { |
blocked_registers[locs->out(0).reg()] = true; |
} |
- // Block all non-free registers. |
- for (intptr_t i = 0; i < kFirstFreeCpuRegister; i++) { |
- blocked_registers[i] = true; |
- } |
- for (intptr_t i = kLastFreeCpuRegister + 1; i < kNumberOfCpuRegisters; i++) { |
- blocked_registers[i] = true; |
- } |
- |
// Allocate all unallocated input locations. |
const bool should_pop = !instr->IsPushArgument() && !instr->IsPushTemp(); |
for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { |
@@ -1582,8 +1558,8 @@ ParallelMoveResolver::ScratchRegisterScope::ScratchRegisterScope( |
reg_ = static_cast<Register>( |
resolver_->AllocateScratchRegister(Location::kRegister, |
blocked_mask, |
- kFirstFreeCpuRegister, |
- kLastFreeCpuRegister, |
+ 0, |
+ kNumberOfCpuRegisters - 1, |
&spilled_)); |
if (spilled_) { |