Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1417433002: Don't touch x18 on ARM64 - it is globally reserved on iOS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_) {
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698