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

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

Issue 1229893002: dart2js cps: Redundant join elimination. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « pkg/compiler/lib/src/cps_ir/redundant_join.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.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 f27b054dbc55a72c28694d686b55caf71384d840..d1a8fe57d7468f91618b96176a74060aa14b043c 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'optimizers.dart' show Pass, ParentVisitor;
+import 'optimizers.dart';
import '../constants/constant_system.dart';
import '../resolution/operators.dart';
@@ -443,22 +443,13 @@ class ConstantPropagationLattice {
}
}
- bool isEmptyString(ConstantValue value) {
- return value is StringConstantValue && value.primitiveValue.isEmpty;
- }
-
/// Returns whether [value] is one of the falsy values: false, 0, -0, NaN,
/// the empty string, or null.
AbstractBool boolify(AbstractValue value) {
if (value.isNothing) return AbstractBool.Nothing;
if (value.isConstant) {
ConstantValue constantValue = value.constant;
- if (constantValue.isFalse ||
- constantValue.isNull ||
- constantValue.isZero ||
- constantValue.isMinusZero ||
- constantValue.isNaN ||
- isEmptyString(constantValue)) {
+ if (isFalsyConstant(constantValue)) {
return AbstractBool.False;
} else {
return AbstractBool.True;
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/redundant_join.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698