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

Unified Diff: pkg/compiler/lib/src/types/masks.dart

Issue 2813093002: Remove BackendClasses and JavaScriptBackendClasses. (Closed)
Patch Set: . Created 3 years, 8 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/types/map_type_mask.dart ('k') | pkg/compiler/lib/src/universe/function_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/masks.dart
diff --git a/pkg/compiler/lib/src/types/masks.dart b/pkg/compiler/lib/src/types/masks.dart
index 0f8fc76afa63bcae6e46d4409dccb41d51783ef7..15d17c8b6e5664fd37614aad54de7fb85a417086 100644
--- a/pkg/compiler/lib/src/types/masks.dart
+++ b/pkg/compiler/lib/src/types/masks.dart
@@ -5,7 +5,7 @@
library masks;
import '../common.dart';
-import '../common/backend_api.dart' show BackendClasses;
+import '../common_elements.dart' show CommonElements;
import '../constants/values.dart' show PrimitiveConstantValue;
import '../elements/entities.dart';
import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
@@ -36,7 +36,7 @@ class CommonMasks {
CommonMasks(this.closedWorld);
- BackendClasses get backendClasses => closedWorld.backendClasses;
+ CommonElements get commonElements => closedWorld.commonElements;
TypeMask _dynamicType;
TypeMask _nonNullType;
@@ -75,64 +75,64 @@ class CommonMasks {
closedWorld.commonElements.objectClass, closedWorld);
TypeMask get intType => _intType ??=
- new TypeMask.nonNullSubclass(backendClasses.intClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsIntClass, closedWorld);
TypeMask get uint32Type => _uint32Type ??=
- new TypeMask.nonNullSubclass(backendClasses.uint32Class, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsUInt32Class, closedWorld);
TypeMask get uint31Type => _uint31Type ??=
- new TypeMask.nonNullExact(backendClasses.uint31Class, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsUInt31Class, closedWorld);
TypeMask get positiveIntType =>
_positiveIntType ??= new TypeMask.nonNullSubclass(
- backendClasses.positiveIntClass, closedWorld);
+ commonElements.jsPositiveIntClass, closedWorld);
TypeMask get doubleType => _doubleType ??=
- new TypeMask.nonNullExact(backendClasses.doubleClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsDoubleClass, closedWorld);
TypeMask get numType => _numType ??=
- new TypeMask.nonNullSubclass(backendClasses.numClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsNumberClass, closedWorld);
TypeMask get boolType => _boolType ??=
- new TypeMask.nonNullExact(backendClasses.boolClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsBoolClass, closedWorld);
TypeMask get functionType => _functionType ??=
- new TypeMask.nonNullSubtype(backendClasses.functionClass, closedWorld);
+ new TypeMask.nonNullSubtype(commonElements.functionClass, closedWorld);
TypeMask get listType => _listType ??=
- new TypeMask.nonNullExact(backendClasses.listClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsArrayClass, closedWorld);
- TypeMask get constListType => _constListType ??=
- new TypeMask.nonNullExact(backendClasses.constListClass, closedWorld);
+ TypeMask get constListType => _constListType ??= new TypeMask.nonNullExact(
+ commonElements.jsUnmodifiableArrayClass, closedWorld);
TypeMask get fixedListType => _fixedListType ??=
- new TypeMask.nonNullExact(backendClasses.fixedListClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, closedWorld);
- TypeMask get growableListType => _growableListType ??=
- new TypeMask.nonNullExact(backendClasses.growableListClass, closedWorld);
+ TypeMask get growableListType =>
+ _growableListType ??= new TypeMask.nonNullExact(
+ commonElements.jsExtendableArrayClass, closedWorld);
TypeMask get mapType => _mapType ??=
- new TypeMask.nonNullSubtype(backendClasses.mapClass, closedWorld);
+ new TypeMask.nonNullSubtype(commonElements.mapLiteralClass, closedWorld);
- TypeMask get constMapType => _constMapType ??=
- new TypeMask.nonNullSubtype(backendClasses.constMapClass, closedWorld);
+ TypeMask get constMapType => _constMapType ??= new TypeMask.nonNullSubtype(
+ commonElements.constMapLiteralClass, closedWorld);
TypeMask get stringType => _stringType ??=
- new TypeMask.nonNullExact(backendClasses.stringClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsStringClass, closedWorld);
TypeMask get typeType => _typeType ??=
- new TypeMask.nonNullExact(backendClasses.typeClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.typeLiteralClass, closedWorld);
- TypeMask get syncStarIterableType =>
- _syncStarIterableType ??= new TypeMask.nonNullExact(
- backendClasses.syncStarIterableClass, closedWorld);
+ TypeMask get syncStarIterableType => _syncStarIterableType ??=
+ new TypeMask.nonNullExact(commonElements.syncStarIterable, closedWorld);
- TypeMask get asyncFutureType => _asyncFutureType ??=
- new TypeMask.nonNullExact(backendClasses.asyncFutureClass, closedWorld);
+ TypeMask get asyncFutureType =>
+ _asyncFutureType ??= new TypeMask.nonNullExact(
+ commonElements.futureImplementation, closedWorld);
- TypeMask get asyncStarStreamType =>
- _asyncStarStreamType ??= new TypeMask.nonNullExact(
- backendClasses.asyncStarStreamClass, closedWorld);
+ TypeMask get asyncStarStreamType => _asyncStarStreamType ??=
+ new TypeMask.nonNullExact(commonElements.controllerStream, closedWorld);
// TODO(johnniwinther): Assert that the null type has been resolved.
TypeMask get nullType => _nullType ??= const TypeMask.empty();
@@ -140,27 +140,29 @@ class CommonMasks {
TypeMask get emptyType => const TypeMask.nonNullEmpty();
TypeMask get indexablePrimitiveType => _indexablePrimitiveType ??=
- new TypeMask.nonNullSubtype(backendClasses.indexableClass, closedWorld);
+ new TypeMask.nonNullSubtype(commonElements.jsIndexableClass, closedWorld);
TypeMask get readableArrayType => _readableArrayType ??=
- new TypeMask.nonNullSubclass(backendClasses.listClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsArrayClass, closedWorld);
TypeMask get mutableArrayType =>
_mutableArrayType ??= new TypeMask.nonNullSubclass(
- backendClasses.mutableListClass, closedWorld);
+ commonElements.jsMutableArrayClass, closedWorld);
TypeMask get fixedArrayType => _fixedArrayType ??=
- new TypeMask.nonNullExact(backendClasses.fixedListClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, closedWorld);
- TypeMask get extendableArrayType => _extendableArrayType ??=
- new TypeMask.nonNullExact(backendClasses.growableListClass, closedWorld);
+ TypeMask get extendableArrayType =>
+ _extendableArrayType ??= new TypeMask.nonNullExact(
+ commonElements.jsExtendableArrayClass, closedWorld);
- TypeMask get unmodifiableArrayType => _unmodifiableArrayType ??=
- new TypeMask.nonNullExact(backendClasses.constListClass, closedWorld);
+ TypeMask get unmodifiableArrayType =>
+ _unmodifiableArrayType ??= new TypeMask.nonNullExact(
+ commonElements.jsUnmodifiableArrayClass, closedWorld);
TypeMask get interceptorType =>
_interceptorType ??= new TypeMask.nonNullSubclass(
- backendClasses.interceptorClass, closedWorld);
+ commonElements.jsInterceptorClass, closedWorld);
bool isTypedArray(TypeMask mask) {
// Just checking for [:TypedData:] is not sufficient, as it is an
@@ -170,8 +172,8 @@ class CommonMasks {
return typedDataClass != null &&
closedWorld.isInstantiated(typedDataClass) &&
mask.satisfies(typedDataClass, closedWorld) &&
- mask.satisfies(
- closedWorld.backendClasses.indexingBehaviorClass, closedWorld);
+ mask.satisfies(closedWorld.commonElements.jsIndexingBehaviorInterface,
+ closedWorld);
}
bool couldBeTypedArray(TypeMask mask) {
@@ -186,7 +188,8 @@ class CommonMasks {
intersects(
mask,
new TypeMask.subtype(
- closedWorld.backendClasses.indexingBehaviorClass, closedWorld));
+ closedWorld.commonElements.jsIndexingBehaviorInterface,
+ closedWorld));
}
TypeMask createNonNullExact(ClassEntity cls) {
« no previous file with comments | « pkg/compiler/lib/src/types/map_type_mask.dart ('k') | pkg/compiler/lib/src/universe/function_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698