| 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
|
|
|