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

Unified Diff: runtime/vm/intermediate_language.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/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index cc0c7dfe49b706488dc29d0c9ade189d312eb7eb..699cd19c06cc94cd7d56734d9984e6369bc72e78 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -6,6 +6,7 @@
#include "vm/bit_vector.h"
#include "vm/dart_entry.h"
+#include "vm/flow_graph_allocator.h"
#include "vm/flow_graph_builder.h"
#include "vm/flow_graph_compiler.h"
#include "vm/locations.h"
@@ -1359,6 +1360,38 @@ void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+void Environment::InitializeLocations(FlowGraphAllocator* allocator,
+ intptr_t block_start_pos,
+ intptr_t environment_pos) {
+ // 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 -----*
+ //
+ ASSERT(locations_ == NULL);
+ location_count_ = values_.length();
+ if (location_count_ > 0) {
+ locations_ =
+ Isolate::Current()->current_zone()->Alloc<Location>(location_count_);
+ for (intptr_t i = 0; i < location_count_; ++i) {
+ Value* value = values_[i];
+ if (value->IsUse()) {
+ locations_[i] = Location::Any();
+ const intptr_t vreg = value->AsUse()->definition()->ssa_temp_index();
+ LiveRange* range = allocator->GetLiveRange(vreg);
+ range->AddUseInterval(block_start_pos, environment_pos);
+ range->AddUse(environment_pos, &locations_[i]);
+ } else {
+ ASSERT(value->IsConstant());
+ locations_[i] = Location::NoLocation();
+ }
+ }
+ }
+}
+
+
#undef __
} // namespace dart
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698