Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.cc |
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc |
| index 0f4966f9e9a7fb40b00ea7f8c943e9eb12ab3069..143ef664b79347ce89b45a2e678c8e0480c1a85e 100644 |
| --- a/runtime/vm/flow_graph_builder.cc |
| +++ b/runtime/vm/flow_graph_builder.cc |
| @@ -2386,10 +2386,19 @@ void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) { |
| void EffectGraphVisitor::VisitStringInterpolateNode( |
| StringInterpolateNode* node) { |
| ValueGraphVisitor for_argument(owner()); |
| - node->value()->Visit(&for_argument); |
| + ArrayNode* arguments = node->value(); |
| + intptr_t length = arguments->length(); |
| + bool singleton = false; |
| + if (length == 1) { |
|
Florian Schneider
2014/09/12 10:33:37
Drop length and replace with just arguments->lengt
Lasse Reichstein Nielsen
2014/09/12 12:49:39
Done.
|
| + arguments->ElementAt(0)->Visit(&for_argument); |
| + singleton = true; |
| + } else { |
| + arguments->Visit(&for_argument); |
| + } |
| Append(for_argument); |
| StringInterpolateInstr* instr = |
| - new(I) StringInterpolateInstr(for_argument.value(), node->token_pos()); |
| + new(I) StringInterpolateInstr(for_argument.value(), node->token_pos(), |
| + singleton); |
| ReturnDefinition(instr); |
| } |