| Index: runtime/vm/intermediate_language.cc
|
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
|
| index 425a063835a62df4b2b0ec3d05116fcb2a6066de..321e005eb5f8b8e6d186da1d1c581fc396d5bcd1 100644
|
| --- a/runtime/vm/intermediate_language.cc
|
| +++ b/runtime/vm/intermediate_language.cc
|
| @@ -1653,12 +1653,13 @@ void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|
|
| Environment* Environment::From(const GrowableArray<Definition*>& definitions,
|
| intptr_t fixed_parameter_count,
|
| - const Environment* outer) {
|
| + const Function& function) {
|
| Environment* env =
|
| new Environment(definitions.length(),
|
| fixed_parameter_count,
|
| Isolate::kNoDeoptId,
|
| - (outer == NULL) ? NULL : outer->DeepCopy());
|
| + function,
|
| + NULL);
|
| for (intptr_t i = 0; i < definitions.length(); ++i) {
|
| env->values_.Add(new Value(definitions[i]));
|
| }
|
| @@ -1671,6 +1672,7 @@ Environment* Environment::DeepCopy() const {
|
| new Environment(values_.length(),
|
| fixed_parameter_count_,
|
| deopt_id_,
|
| + function_,
|
| (outer_ == NULL) ? NULL : outer_->DeepCopy());
|
| for (intptr_t i = 0; i < values_.length(); ++i) {
|
| copy->values_.Add(values_[i]->Copy());
|
| @@ -1693,6 +1695,22 @@ void Environment::DeepCopyTo(Instruction* instr) const {
|
| }
|
|
|
|
|
| +// Copies the environment as outer on an inlined instruction and updates the
|
| +// environment use lists.
|
| +void Environment::DeepCopyToOuter(Instruction* instr) const {
|
| + ASSERT(instr->env()->outer() == NULL);
|
| + Environment* copy = DeepCopy();
|
| + intptr_t use_index = instr->env()->Length(); // Start index after inner.
|
| + for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) {
|
| + Value* value = it.CurrentValue();
|
| + value->set_instruction(instr);
|
| + value->set_use_index(use_index++);
|
| + value->AddToEnvUseList();
|
| + }
|
| + instr->env()->outer_ = copy;
|
| +}
|
| +
|
| +
|
| #undef __
|
|
|
| } // namespace dart
|
|
|