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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10870100: Environment sets the environment position when copying to maintain the use lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Set the env. 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 2feac05d8c30c8ecb13a06571aacd8c67d812802..8cd4099c8d334a3780f1fd9d5ab8bd190f7c6f9f 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1530,14 +1530,22 @@ Environment::Environment(const GrowableArray<Definition*>& definitions,
}
-Environment* Environment::Copy() const {
+// Copies the environment and updates the environment use lists.
+void Environment::CopyTo(Instruction* instr) const {
Environment* copy = new Environment(values().length(),
fixed_parameter_count());
GrowableArray<Value*>* values_copy = copy->values_ptr();
for (intptr_t i = 0; i < values().length(); ++i) {
- values_copy->Add(values()[i]->CopyValue());
+ Value* value = values()[i]->CopyValue();
+ values_copy->Add(value);
+ UseVal* use = value->AsUse();
+ if (use != NULL) {
+ use->set_instruction(instr);
+ use->set_use_index(i);
+ use->AddToEnvUseList();
+ }
}
- return copy;
+ instr->set_env(copy);
}
« 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