| Index: runtime/vm/intermediate_language.cc
|
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
|
| index f03e780798f17499dc74b9bd82cdb1f770cfd946..cfd51ef96a06aab0ad7ce24e14be9a2faccf43d9 100644
|
| --- a/runtime/vm/intermediate_language.cc
|
| +++ b/runtime/vm/intermediate_language.cc
|
| @@ -1828,7 +1828,17 @@ void Environment::DeepCopyTo(Instruction* instr) const {
|
| // environment use lists.
|
| void Environment::DeepCopyToOuter(Instruction* instr) const {
|
| ASSERT(instr->env()->outer() == NULL);
|
| - Environment* copy = DeepCopy();
|
| + // Create a deep copy removing caller arguments from the environment.
|
| + intptr_t argument_count = instr->env()->fixed_parameter_count();
|
| + Environment* copy =
|
| + new Environment(values_.length() - argument_count,
|
| + fixed_parameter_count_,
|
| + deopt_id_,
|
| + function_,
|
| + (outer_ == NULL) ? NULL : outer_->DeepCopy());
|
| + for (intptr_t i = 0; i < values_.length() - argument_count; ++i) {
|
| + copy->values_.Add(values_[i]->Copy());
|
| + }
|
| intptr_t use_index = instr->env()->Length(); // Start index after inner.
|
| for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) {
|
| Value* value = it.CurrentValue();
|
|
|