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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10952002: Reapply "Deoptimization support in inlined code." (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/intermediate_language.h ('k') | runtime/vm/intrinsifier.h » ('j') | 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 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698