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

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

Issue 1188253006: dart2js cps: Replace getter/setter calls with direct field access. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix test case 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/cps_ir/shrinking_reductions.dart
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 9988f4724ea68fd59e8ee7567ff93ff64d214ae3..be5cc9c3a0df3efb84b023b8706cc9d0e887033c 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -246,8 +246,11 @@ class ShrinkingReducer extends Pass {
}
}
-/// Returns true iff the bound primitive is unused.
-bool _isDeadVal(LetPrim node) => !node.primitive.hasAtLeastOneUse;
+/// Returns true iff the bound primitive is unused, and has no effects
+/// preventing it from being eliminated.
+bool _isDeadVal(LetPrim node) {
+ return node.primitive.hasNoUses && node.primitive.isSafeForElimination;
+}
/// Returns true iff the continuation is unused.
bool _isDeadCont(Continuation cont) {

Powered by Google App Engine
This is Rietveld 408576698