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

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: Review comments 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_allocator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c60ee6d788403975ea86a1d4619d8604e09abac1 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -130,12 +130,16 @@ 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 arg_index = 0;
+ GrowableArray<Definition*>* defns =
+ callee_graph->graph_entry()->initial_definitions();
+ for (intptr_t i = 0; i < defns->length(); ++i) {
+ ParameterInstr* param = (*defns)[i]->AsParameter();
+ if (param != NULL) {
+ param->ReplaceUsesWith((*arguments)[arg_index++]->definition());
+ }
}
+ ASSERT(arg_index == arguments->length());
// Replace callee's null constant with caller's null constant.
callee_graph->graph_entry()->constant_null()->ReplaceUsesWith(
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698