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

Unified Diff: src/compiler/greedy-allocator.cc

Issue 1380863004: Revert of Reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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 | « src/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/greedy-allocator.cc
diff --git a/src/compiler/greedy-allocator.cc b/src/compiler/greedy-allocator.cc
index 5742801d69dd26675e88f9d8c0d8fad2906884d9..e0368bf366fe73a7d03dbf0aaaaceaee74957552 100644
--- a/src/compiler/greedy-allocator.cc
+++ b/src/compiler/greedy-allocator.cc
@@ -249,8 +249,7 @@
float eviction_weight = group_weight;
int eviction_reg = -1;
int free_reg = -1;
- for (int i = 0; i < num_allocatable_registers(); ++i) {
- int reg = allocatable_register_code(i);
+ for (int reg = 0; reg < num_registers(); ++reg) {
float weight = GetMaximumConflictingWeight(reg, group, group_weight);
if (weight == LiveRange::kInvalidWeight) {
free_reg = reg;
@@ -314,20 +313,19 @@
// Seek either the first free register, or, from the set of registers
// where the maximum conflict is lower than the candidate's weight, the one
// with the smallest such weight.
- for (int i = 0; i < num_allocatable_registers(); i++) {
- int reg = allocatable_register_code(i);
+ for (int i = 0; i < num_registers(); i++) {
// Skip unnecessarily re-visiting the hinted register, if any.
- if (reg == hinted_reg) continue;
+ if (i == hinted_reg) continue;
float max_conflict_weight =
- GetMaximumConflictingWeight(reg, range, competing_weight);
+ GetMaximumConflictingWeight(i, range, competing_weight);
if (max_conflict_weight == LiveRange::kInvalidWeight) {
- free_reg = reg;
+ free_reg = i;
break;
}
if (max_conflict_weight < range->weight() &&
max_conflict_weight < smallest_weight) {
smallest_weight = max_conflict_weight;
- evictable_reg = reg;
+ evictable_reg = i;
}
}
}
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698