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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 10939031: Replace start_env with initial_definitions in GraphEntryInstr. (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
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 1d4cb8b70a7f568b53cf3ee9cd8b487e52d358f9..fd0b4dff131840ce2c273fe99e658aab875a46b5 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -130,12 +130,17 @@ class CallSiteInliner : public FlowGraphVisitor {
}
// Replace formal parameters with actuals.
- for (intptr_t i = 0; i < arguments->length(); ++i) {
- Value* val = callee_graph->graph_entry()->start_env()->ValueAt(i);
- ParameterInstr* param = val->definition()->AsParameter();
- ASSERT(param != NULL);
- param->ReplaceUsesWith((*arguments)[i]->definition());
+ intptr_t j = 0;
+ for (intptr_t i = 0;
+ i < callee_graph->graph_entry()->initial_definitions().length();
+ ++i) {
+ ParameterInstr* param =
+ callee_graph->graph_entry()->initial_definitions()[i]->AsParameter();
+ if (param != NULL) {
+ param->ReplaceUsesWith((*arguments)[j++]->definition());
+ }
}
+ ASSERT(j == arguments->length());
// Replace callee's null constant with caller's null constant.
callee_graph->graph_entry()->constant_null()->ReplaceUsesWith(

Powered by Google App Engine
This is Rietveld 408576698