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

Unified Diff: frog/leg/ssa/optimize.dart

Issue 9293006: Refactoring of string literals. Implement static string addition. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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: frog/leg/ssa/optimize.dart
diff --git a/frog/leg/ssa/optimize.dart b/frog/leg/ssa/optimize.dart
index b76868c28d931e72e42665b9272bc1cb0e2c0d74..694d1bbe301fb0b0b630d3fdf3fd9f7963442285 100644
--- a/frog/leg/ssa/optimize.dart
+++ b/frog/leg/ssa/optimize.dart
@@ -103,7 +103,7 @@ class SsaConstantFolder extends HBaseVisitor {
// First try to eliminate adding the empty string to a string.
if (node.right.isLiteralString()) {
HLiteral right = node.right;
- QuotedString rightString = right.value;
+ DartString rightString = right.value;
if (rightString.isEmpty()) {
// String has no content, i.e., it's the empty string.
return node.left;
@@ -112,7 +112,7 @@ class SsaConstantFolder extends HBaseVisitor {
// Then, if both are literals, try to do the concatenation statically.
if (node.left.isLiteralString()) {
HLiteral left = node.left;
- QuotedString leftString = left.value;
+ DartString leftString = left.value;
if (leftString.isEmpty()) {
// Left is empty String.
if (node.right.isString()) {
@@ -134,7 +134,7 @@ class SsaConstantFolder extends HBaseVisitor {
} else {
str = right.value.toString();
}
- return new HLiteral(new QuotedString.literal(str), HType.STRING);
+ return new HLiteral(new DartString.literal(str), HType.STRING);
}
}
// TODO(lrn): Perform concatenation in Dart.

Powered by Google App Engine
This is Rietveld 408576698