| Index: vm/flow_graph_builder.cc
|
| ===================================================================
|
| --- vm/flow_graph_builder.cc (revision 7782)
|
| +++ vm/flow_graph_builder.cc (working copy)
|
| @@ -1371,12 +1371,8 @@
|
| }
|
|
|
|
|
| -void EffectGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) {
|
| - // Context is saved around the call, it's treated as an extra operand
|
| - // consumed by the call (but not an argument).
|
| - BindInstr* context = new BindInstr(new CurrentContextComp());
|
| - AddInstruction(context);
|
| -
|
| +ClosureCallComp* EffectGraphVisitor::BuildClosureCall(
|
| + ClosureCallNode* node) {
|
| ValueGraphVisitor for_closure(owner(), temp_index());
|
| node->closure()->Visit(&for_closure);
|
| Append(for_closure);
|
| @@ -1385,15 +1381,34 @@
|
| new ZoneGrowableArray<Value*>(node->arguments()->length());
|
| arguments->Add(for_closure.value());
|
| TranslateArgumentList(*node->arguments(), arguments);
|
| - // First operand is the saved context, consumed by the call.
|
| - ClosureCallComp* call = new ClosureCallComp(node,
|
| - owner()->try_index(),
|
| - new UseVal(context),
|
| - arguments);
|
| - ReturnComputation(call);
|
| +
|
| + // Save context around the call.
|
| + BuildStoreContext(*owner()->parsed_function().expression_temp_var());
|
| + return new ClosureCallComp(node, owner()->try_index(), arguments);
|
| }
|
|
|
|
|
| +void EffectGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) {
|
| + ClosureCallComp* call = BuildClosureCall(node);
|
| + AddInstruction(new DoInstr(call));
|
| +
|
| + // Restore context from saved location.
|
| + BuildLoadContext(*owner()->parsed_function().expression_temp_var());
|
| +}
|
| +
|
| +
|
| +void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) {
|
| + ClosureCallComp* call = BuildClosureCall(node);
|
| + BindInstr* result = new BindInstr(call);
|
| + AddInstruction(result);
|
| +
|
| + // Restore context from temp.
|
| + BuildLoadContext(*owner()->parsed_function().expression_temp_var());
|
| +
|
| + ReturnValue(new UseVal(result));
|
| +}
|
| +
|
| +
|
| void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) {
|
| BindInstr* context = new BindInstr(new CurrentContextComp());
|
| AddInstruction(context);
|
|
|