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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10831179: Allocate the environment's location backing store during register allocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Store location count to enable bounds checking assertions. Created 8 years, 4 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 | runtime/vm/il_printer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 8e9e197ec1ae4d9793591a66a64d10471f851178..8a2a4a45aa90ed03716d515a26b4d7d627615f1d 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -662,19 +662,20 @@ void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block,
Environment* env = current->env();
const GrowableArray<Value*>& values = env->values();
-
+ env->InitializeLocations();
srdjan 2012/08/06 22:49:25 I would move the loop below into InitializeLocatio
for (intptr_t j = 0; j < values.length(); j++) {
Value* val = values[j];
+ Location* loc = env->LocationSlotAt(j);
if (val->IsUse()) {
- env->AddLocation(Location::Any());
+ *loc = Location::Any();
const intptr_t vreg = val->AsUse()->definition()->ssa_temp_index();
LiveRange* range = GetLiveRange(vreg);
range->AddUseInterval(block->start_pos(), pos + 1);
- range->AddUse(pos + 1, env->LocationSlotAt(j));
+ range->AddUse(pos + 1, loc);
} else {
ASSERT(val->IsConstant());
- env->AddLocation(Location::NoLocation());
+ *loc = Location::NoLocation();
}
}
}
« no previous file with comments | « no previous file | runtime/vm/il_printer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698