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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 1212663004: dart2js cps: Fix a couple of minor issues. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 68b84593ebdbc9b236477d96851e83fd25ef4a24..bad76909807a1877fde5eadd09770db1006a9cfb 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -307,7 +307,7 @@ class StatementRewriter extends Transformer implements Pass {
// Handle constant assignments specially.
// They are always safe to propagate (though we should avoid duplication).
// Moreover, they should not prevent other expressions from propagating.
- if (assign.variable.readCount <= 1) {
+ if (assign.variable.readCount == 1) {
asgerf 2015/06/29 14:09:12 This matters when there is a dead variable due to
// A single-use constant should always be propagted to its use site.
constantEnvironment[assign.variable] = assign.value;
--assign.variable.writeCount;

Powered by Google App Engine
This is Rietveld 408576698