Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 563973004: Call special VM interpolate for single element interpolation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698