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

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

Issue 1385423002: dart2js cps_ir: Use interceptors for is-checks (version 2) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix analyzer warnings Created 5 years, 2 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_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 a84d28d4ba5cd333e83868f839722da0da625407..d403b2fd17ce68bb7deaf8fa9ab0555ab4677ac4 100644
--- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -42,6 +42,7 @@ class TypeMaskSystem {
TypeMask get extendableNativeListType => backend.extendableArrayType;
TypeMask numStringBoolType;
+ TypeMask interceptorType;
ClassElement get jsNullClass => backend.jsNullClass;
@@ -63,6 +64,8 @@ class TypeMaskSystem {
numStringBoolType =
new TypeMask.unionOf(<TypeMask>[anyNum, anyString, anyBool],
classWorld);
+ interceptorType =
+ new TypeMask.nonNullSubtype(backend.jsInterceptorClass, classWorld);
}
bool methodUsesReceiverArgument(FunctionElement function) {
@@ -199,6 +202,9 @@ class TypeMaskSystem {
return t.satisfies(backend.jsIntClass, classWorld);
}
+ // TODO(sra): Find a better name. 'NativeList' is a bad name because there
+ // are many native classes in dart:html that implement List but are not (and
+ // should not be) included in this predicate.
bool isDefinitelyNativeList(TypeMask t, {bool allowNull: false}) {
if (!allowNull && t.isNullable) return false;
return t.nonNullable().satisfies(backend.jsArrayClass, classWorld);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698