Chromium Code Reviews| 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; |
|
Kevin Millikin (Google)
2012/09/19 11:49:29
j ==> arg_index or arg_idx or the like.
|
| + 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( |