Chromium Code Reviews| Index: vm/flow_graph_builder.cc |
| =================================================================== |
| --- vm/flow_graph_builder.cc (revision 9930) |
| +++ vm/flow_graph_builder.cc (working copy) |
| @@ -1375,6 +1375,7 @@ |
| } else { |
| receiver = BuildNullValue(); |
| } |
| + AddInstruction(new PushArgumentInstr(receiver)); |
| ASSERT(function.context_scope() != ContextScope::null()); |
| // The function type of a closure may have type arguments. In that case, pass |
| @@ -1389,10 +1390,8 @@ |
| } else { |
| type_arguments = BuildNullValue(); |
| } |
| - |
| - CreateClosureComp* create = new CreateClosureComp( |
| - node, owner()->try_index(), type_arguments, receiver); |
| - ReturnComputation(create); |
| + AddInstruction(new PushArgumentInstr(type_arguments)); |
| + ReturnComputation(new CreateClosureComp(node, owner()->try_index())); |
|
Kevin Millikin (Google)
2012/07/26 13:03:18
I imagine we'll also want a list of the push argum
Florian Schneider
2012/07/26 13:45:24
Done.
|
| } |
| @@ -1407,6 +1406,21 @@ |
| } |
| } |
| + |
| +void EffectGraphVisitor::BuildPushArguments( |
| + const ArgumentListNode& node, |
| + ZoneGrowableArray<PushArgumentInstr*>* values) { |
| + for (intptr_t i = 0; i < node.length(); ++i) { |
| + ValueGraphVisitor for_argument(owner(), temp_index()); |
| + node.NodeAt(i)->Visit(&for_argument); |
| + Append(for_argument); |
| + PushArgumentInstr* push_arg = new PushArgumentInstr(for_argument.value()); |
| + AddInstruction(push_arg); |
| + values->Add(push_arg); |
| + } |
| +} |
| + |
| + |
| void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) { |
| ArgumentListNode* arguments = node->arguments(); |
| int length = arguments->length(); |
| @@ -1447,11 +1461,13 @@ |
| ValueGraphVisitor for_closure(owner(), temp_index()); |
| node->closure()->Visit(&for_closure); |
| Append(for_closure); |
| + PushArgumentInstr* push_closure = new PushArgumentInstr(for_closure.value()); |
| + AddInstruction(push_closure); |
| - ZoneGrowableArray<Value*>* arguments = |
| - new ZoneGrowableArray<Value*>(node->arguments()->length()); |
| - arguments->Add(for_closure.value()); |
| - TranslateArgumentList(*node->arguments(), arguments); |
| + ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| + new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length()); |
| + arguments->Add(push_closure); |
| + BuildPushArguments(*node->arguments(), arguments); |
| // Save context around the call. |
| BuildStoreContext(*owner()->parsed_function().expression_temp_var()); |