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

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: Address comments. 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
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..37dddf1a3e2cf1abcc3576c5647b8bb99e27a79e 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2386,10 +2386,18 @@ void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
void EffectGraphVisitor::VisitStringInterpolateNode(
StringInterpolateNode* node) {
ValueGraphVisitor for_argument(owner());
- node->value()->Visit(&for_argument);
+ ArrayNode* arguments = node->value();
+ bool is_singleton = false;
+ if (arguments->length() == 1) {
+ arguments->ElementAt(0)->Visit(&for_argument);
+ is_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(),
+ is_singleton);
ReturnDefinition(instr);
}
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698