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

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

Issue 1604333002: Implement TypeMask.isDisjoint instead of using intersection. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 | pkg/compiler/lib/src/ssa/interceptor_simplifier.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_mask_system.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
index 25fb1c9e8c20394e22760ebd427f3cf34b1c17eb..0a21c3f657152af2c858ed7ef23181c27822e378 100644
--- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -448,10 +448,8 @@ class TypeMaskSystem implements AbstractValueDomain {
}
@override
- bool areDisjoint(TypeMask leftType, TypeMask rightType) {
- TypeMask intersected = intersection(leftType, rightType);
- return intersected.isEmpty && !intersected.isNullable;
- }
+ bool areDisjoint(TypeMask leftType, TypeMask rightType) =>
+ leftType.isDisjoint(rightType, classWorld);
@override
bool isMorePreciseOrEqual(TypeMask t1, TypeMask t2) {
@@ -468,8 +466,8 @@ class TypeMaskSystem implements AbstractValueDomain {
}
if (type is types.InterfaceType) {
TypeMask typeAsMask = allowNull
- ? new TypeMask.subtype(type.element, classWorld)
- : new TypeMask.nonNullSubtype(type.element, classWorld);
+ ? new TypeMask.subtype(type.element, classWorld)
+ : new TypeMask.nonNullSubtype(type.element, classWorld);
if (areDisjoint(value, typeAsMask)) {
// Disprove the subtype relation based on the class alone.
return AbstractBool.False;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698