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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10960053: Remove caller arguments from nested deoptimization environments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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_compiler.cc ('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 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();
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698