Chromium Code Reviews| Index: runtime/vm/flow_graph_inliner.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_inliner.cc (revision 41279) |
| +++ runtime/vm/flow_graph_inliner.cc (working copy) |
| @@ -926,6 +926,15 @@ |
| constant->ReplaceUsesWith( |
| caller_graph_->GetConstant(constant->value())); |
| } |
| + CurrentContextInstr* context = (*defns)[i]->AsCurrentContext(); |
| + if ((context != NULL) && context->HasUses()) { |
| + if (call->IsClosureCall()) { |
| + context->ReplaceUsesWith( |
| + call->AsClosureCall()->context()->definition()); |
| + } else { |
| + context->ReplaceUsesWith(caller_graph_->CurrentContext(call->env())); |
|
Vyacheslav Egorov (Google)
2014/10/28 13:44:58
Just use the empty one here. If it's not a closure
Florian Schneider
2014/10/28 19:04:31
Done.
|
| + } |
| + } |
| } |
| // Check that inlining maintains use lists. |
| @@ -1335,6 +1344,16 @@ |
| constant->ReplaceUsesWith( |
| owner_->caller_graph()->GetConstant(constant->value())); |
| } |
| + CurrentContextInstr* context = (*defns)[i]->AsCurrentContext(); |
| + if ((context != NULL) && context->HasUses()) { |
| + if (call_data.call->IsClosureCall()) { |
| + context->ReplaceUsesWith( |
| + call_data.call->AsClosureCall()->context()->definition()); |
| + } else { |
| + context->ReplaceUsesWith( |
| + owner_->caller_graph()->CurrentContext(call_data.call->env())); |
|
Vyacheslav Egorov (Google)
2014/10/28 13:44:58
Ditto.
Florian Schneider
2014/10/28 19:04:31
Done.
|
| + } |
| + } |
| } |
| return true; |
| } |