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

Unified Diff: runtime/vm/parser.cc

Issue 26726004: Optimize away empty string sections in string interpolation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 28420)
+++ runtime/vm/parser.cc (working copy)
@@ -3395,7 +3395,7 @@
}
// For static final fields (this includes static const fields), set value to
- // "uninitialized" and create a kFinalImplicitGetter getter method.
+ // "uninitialized" and create a kImplicitStaticFinalGetter getter method.
if (field->has_static && has_initializer) {
class_field.set_value(init_value);
if (!has_simple_literal) {
@@ -10045,7 +10045,11 @@
bool is_compiletime_const = true;
GrowableArray<AstNode*> values_list;
while (CurrentToken() == Token::kSTRING) {
- values_list.Add(new LiteralNode(TokenPos(), *CurrentLiteral()));
+ if (CurrentLiteral()->Length() > 0) {
+ // Only add non-empty string sections to the values list
+ // that will be concatenated.
+ values_list.Add(new LiteralNode(TokenPos(), *CurrentLiteral()));
+ }
ConsumeToken();
while ((CurrentToken() == Token::kINTERPOL_VAR) ||
(CurrentToken() == Token::kINTERPOL_START)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698