| Index: runtime/vm/flow_graph_builder.cc
|
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
|
| index 01ad7fde8940ebd34d7b186bd028e7dd576ed9f2..439e549214092934424717804d29cd102209774d 100644
|
| --- a/runtime/vm/flow_graph_builder.cc
|
| +++ b/runtime/vm/flow_graph_builder.cc
|
| @@ -561,22 +561,32 @@ void TestGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
|
| }
|
|
|
|
|
| -// <Expression> ::= StaticCall { function: Function
|
| -// arguments: <ArgumentList> }
|
| -StaticCallComp* EffectGraphVisitor::TranslateStaticCall(
|
| - const StaticCallNode& node) {
|
| - ArgumentListNode* arguments = node.arguments();
|
| - int length = arguments->length();
|
| - ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length);
|
| +void EffectGraphVisitor::TranslateArgumentList(
|
| + const ArgumentListNode& node, ZoneGrowableArray<Value*>* values) {
|
| int index = temp_index();
|
| - for (intptr_t i = 0; i < length; ++i) {
|
| + for (intptr_t i = 0; i < node.length(); ++i) {
|
| ValueGraphVisitor for_value(owner(), index);
|
| - arguments->NodeAt(i)->Visit(&for_value);
|
| + node.NodeAt(i)->Visit(&for_value);
|
| Append(for_value);
|
| - CHECK_ALIVE(return NULL);
|
| - values->Add(for_value.value());
|
| + CHECK_ALIVE(return);
|
| + Value* argument_value = for_value.value();
|
| index = for_value.temp_index();
|
| + if (argument_value->IsConstant()) {
|
| + AddInstruction(new BindInstr(index, argument_value));
|
| + argument_value = new TempValue(index++);
|
| + }
|
| + values->Add(argument_value);
|
| }
|
| +}
|
| +
|
| +// <Expression> ::= StaticCall { function: Function
|
| +// arguments: <ArgumentList> }
|
| +StaticCallComp* EffectGraphVisitor::TranslateStaticCall(
|
| + const StaticCallNode& node) {
|
| + int length = node.arguments()->length();
|
| + ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length);
|
| + TranslateArgumentList(*node.arguments(), values);
|
| + CHECK_ALIVE(return NULL);
|
| return new StaticCallComp(node.function(), values);
|
| }
|
|
|
|
|