| Index: runtime/vm/flow_graph_inliner.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_inliner.cc (revision 33058)
|
| +++ runtime/vm/flow_graph_inliner.cc (working copy)
|
| @@ -675,15 +675,18 @@
|
| // TODO(fschneider): Avoid setting the context, if not needed.
|
| Definition* closure =
|
| closure_call->PushArgumentAt(0)->value()->definition();
|
| - LoadFieldInstr* context =
|
| - new LoadFieldInstr(new Value(closure),
|
| - Closure::context_offset(),
|
| - Type::ZoneHandle());
|
| AllocateObjectInstr* alloc =
|
| closure_call->ArgumentAt(0)->AsAllocateObject();
|
| + Definition* context = NULL;
|
| if ((alloc != NULL) && !alloc->closure_function().IsNull()) {
|
| ASSERT(!alloc->context_field().IsNull());
|
| - context->set_field(&alloc->context_field());
|
| + context = new LoadFieldInstr(new Value(closure),
|
| + &alloc->context_field(),
|
| + Type::ZoneHandle());
|
| + } else {
|
| + context = new LoadFieldInstr(new Value(closure),
|
| + Closure::context_offset(),
|
| + Type::ZoneHandle());
|
| }
|
|
|
| context->set_ssa_temp_index(caller_graph()->alloc_ssa_temp_index());
|
|
|