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

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

Issue 1755823003: Replace TypeMask.isEmpty by isEmptyOrNull, use isEmpty when it's really empty. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/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 6b09771cd9a54a246132253c688a695c84d3d542..29ab33d22191e4d6550773f86d021a8dff55c220 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -968,7 +968,7 @@ class TransformingVisitor extends DeepRecursiveVisitor {
}
// If a primitive has a value, but can't return anything, it must throw
// or diverge.
- return prim.hasValue && prim.type.isEmpty && !prim.type.isNullable;
+ return prim.hasValue && prim.type.isEmpty;
}
void visitContinuation(Continuation node) {
@@ -2709,9 +2709,7 @@ class TypePropagationVisitor implements Visitor {
? typeSystem.getParameterType(param.hint)
: typeSystem.dynamicType;
setValue(param, lattice.fromMask(type));
- if (type.isEmpty && !type.isNullable) {
- hasParameterWithoutValue = true;
- }
+ if (type.isEmpty) hasParameterWithoutValue = true;
}
}
if (!hasParameterWithoutValue) { // Don't analyze unreachable code.
@@ -3383,11 +3381,10 @@ class AbstractConstantValue {
factory AbstractConstantValue.nonConstant(TypeMask type) {
if (type.isEmpty) {
- if (type.isNullable)
- return new AbstractConstantValue.constantValue(
- new NullConstantValue(), type);
- else
- return new AbstractConstantValue.nothing();
+ return new AbstractConstantValue.nothing();
+ } else if (type.isNull) {
+ return new AbstractConstantValue.constantValue(
+ new NullConstantValue(), type);
} else {
return new AbstractConstantValue._internal(NONCONST, null, type);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_mask_system.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698