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

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

Issue 9126001: Fix Leg test failures. (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
« no previous file with comments | « frog/leg/ssa/nodes.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/optimize.dart
diff --git a/frog/leg/ssa/optimize.dart b/frog/leg/ssa/optimize.dart
index e6fb69f4f69c940fdbf6dddc59ad90da52dac8b4..c0cc81e620827e6ddb2c6e4b3ec4d5269d949365 100644
--- a/frog/leg/ssa/optimize.dart
+++ b/frog/leg/ssa/optimize.dart
@@ -89,7 +89,7 @@ class SsaConstantFolder extends HBaseVisitor {
// TODO(floitsch): is String + literal a compile-time expression? If not
// we must pay attention not to canonicalize the concatenated string with
// an already existing string.
- if (node.left.isLiteralString() && node.right is HLiteral) {
+ if (node.left.isString() && node.right is HLiteral) {
karlklose 2012/01/06 09:58:38 Remove accidental edit.
Lasse Reichstein 2012/01/06 10:01:07 Done.
// TODO(lrn): Perform concatenation in Dart.
}
return visitInvokeBinary(node);
@@ -99,7 +99,13 @@ class SsaConstantFolder extends HBaseVisitor {
if (node.left is HLiteral && node.right is HLiteral) {
HLiteral op1 = node.left;
HLiteral op2 = node.right;
- return new HLiteral(op1.value == op2.value, HType.BOOLEAN);
+ if (op1.isLiteralString()) {
+ if (op2.isLiteralString() && op1.value.definitlyEquals(op2.value)) {
+ return new HLiteral(true, HType.BOOLEAN);
+ }
+ } else {
+ return new HLiteral(op1.value == op2.value, HType.BOOLEAN);
+ }
}
return node;
}
« no previous file with comments | « frog/leg/ssa/nodes.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698