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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10826184: Move all register allocator environment initialization into class Environment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « runtime/vm/flow_graph_allocator.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
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 7b00b55aa3626b66f56407771ffbaa397c051307..09d6cf11ade2427e9a5af33d378cc1b3c33c859b 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -651,33 +651,9 @@ void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block,
(locs->out().policy() == Location::kSameAsFirstInput);
// Add uses from the deoptimization environment.
- if (current->env() != NULL) {
- // Any value mentioned in the deoptimization environment should survive
- // until the end of instruction but it does not need to be in the register.
- // Expected shape of live range:
- //
- // i i'
- // value -----*
- //
-
- Environment* env = current->env();
- const GrowableArray<Value*>& values = env->values();
- env->InitializeLocations();
- for (intptr_t j = 0; j < values.length(); j++) {
- Value* val = values[j];
- Location* loc = env->LocationSlotAt(j);
- if (val->IsUse()) {
- *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, loc);
- } else {
- ASSERT(val->IsConstant());
- *loc = Location::NoLocation();
- }
- }
+ Environment* env = current->env();
+ if (env != NULL) {
+ env->InitializeLocations(this, block->start_pos(), pos + 1);
}
// Process inputs.
« no previous file with comments | « runtime/vm/flow_graph_allocator.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698