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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1563983002: dart2js cps: Eliminate unary string concatenation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Also update the hint Created 4 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 | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index d20178c440434d09042d737eed2dfef0b6920f1e..bf5658abbf73d3500dc7cb6a4151430945d45876 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2073,6 +2073,11 @@ class TransformingVisitor extends DeepRecursiveVisitor {
if (argumentsWereRemoved) {
node.arguments.removeWhere((ref) => ref == null);
}
+ if (node.arguments.length == 1) {
+ Primitive input = node.arguments[0].definition;
+ node.replaceUsesWith(input);
+ input.useElementAsHint(node.hint);
+ }
// TODO(asgerf): Rebalance nested StringConcats that arise from
// rewriting the + operator to StringConcat.
break;
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698