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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 13963009: Change the order of blocking in AllocateRegistersLocally. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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 14e4dd9eefce52ffe4ee45b8f113b873b3559c9d..45c9e7351ef644a02d67293085405bc5e0f677c2 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -729,20 +729,15 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
bool blocked_registers[kNumberOfCpuRegisters];
// Mark all available registers free.
- for (intptr_t i = 0; i < kFirstFreeCpuRegister; i++) {
- blocked_registers[i] = true;
- }
- for (intptr_t i = kFirstFreeCpuRegister; i <= kLastFreeCpuRegister; i++) {
+ for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) {
blocked_registers[i] = false;
}
- for (intptr_t i = kLastFreeCpuRegister + 1; i < kNumberOfCpuRegisters; i++) {
- blocked_registers[i] = true;
- }
// Mark all fixed input, temp and output registers as used.
for (intptr_t i = 0; i < locs->input_count(); i++) {
Location loc = locs->in(i);
if (loc.IsRegister()) {
+ // Check that a register is not specified twice in the summary.
ASSERT(!blocked_registers[loc.reg()]);
blocked_registers[loc.reg()] = true;
}
@@ -751,6 +746,7 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
for (intptr_t i = 0; i < locs->temp_count(); i++) {
Location loc = locs->temp(i);
if (loc.IsRegister()) {
+ // Check that a register is not specified twice in the summary.
ASSERT(!blocked_registers[loc.reg()]);
blocked_registers[loc.reg()] = true;
}
@@ -773,6 +769,14 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
blocked_registers[PP] = 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();
for (intptr_t i = locs->input_count() - 1; i >= 0; i--) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698