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

Unified Diff: pkg/compiler/lib/src/common/backend_api.dart

Issue 2659883002: Use entities in BackendClasses (Closed)
Patch Set: Updated cf. comments. Created 3 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/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/backend_api.dart
diff --git a/pkg/compiler/lib/src/common/backend_api.dart b/pkg/compiler/lib/src/common/backend_api.dart
index 73e22cd4400660c604609e41221c05467268eefc..d4cf67ab26d24cfbd48a99187009beae420b9caf 100644
--- a/pkg/compiler/lib/src/common/backend_api.dart
+++ b/pkg/compiler/lib/src/common/backend_api.dart
@@ -15,6 +15,7 @@ import '../compiler.dart' show Compiler;
import '../constants/constant_system.dart' show ConstantSystem;
import '../constants/expressions.dart' show ConstantExpression;
import '../constants/values.dart' show ConstantValue;
+import '../elements/types.dart';
import '../elements/resolution_types.dart'
show ResolutionDartType, ResolutionInterfaceType;
import '../elements/elements.dart'
@@ -396,34 +397,123 @@ class BackendSerialization {
/// Interface providing access to core classes used by the backend.
abstract class BackendClasses {
- ClassElement get intImplementation;
- ClassElement get doubleImplementation;
- ClassElement get numImplementation;
- ClassElement get stringImplementation;
- ClassElement get listImplementation;
- ClassElement get mutableListImplementation;
- ClassElement get growableListImplementation;
- ClassElement get fixedListImplementation;
- ClassElement get constListImplementation;
- ClassElement get mapImplementation;
- ClassElement get constMapImplementation;
- ClassElement get functionImplementation;
- ClassElement get typeImplementation;
- ClassElement get boolImplementation;
- ClassElement get nullImplementation;
- ClassElement get uint32Implementation;
- ClassElement get uint31Implementation;
- ClassElement get positiveIntImplementation;
- ClassElement get syncStarIterableImplementation;
- ClassElement get asyncFutureImplementation;
- ClassElement get asyncStarStreamImplementation;
- ClassElement get indexableImplementation;
- ClassElement get mutableIndexableImplementation;
- ClassElement get indexingBehaviorImplementation;
- ClassElement get interceptorImplementation;
-
- bool isDefaultEqualityImplementation(MemberElement element);
- bool isInterceptorClass(ClassElement cls);
- bool isNativeClass(ClassElement element);
- bool isNativeMember(MemberElement element);
+ /// Returns the backend implementation class for `int`. This is the `JSInt`
+ /// class.
+ ClassEntity get intClass;
+
+ /// Returns the backend implementation class for `double`. This is the
+ /// `JSDouble` class.
+ ClassEntity get doubleClass;
+
+ /// Returns the backend implementation class for `num`. This is the `JSNum`
+ /// class.
+ ClassEntity get numClass;
+
+ /// Returns the backend implementation class for `String`. This is the
+ /// `JSString` class.
+ ClassEntity get stringClass;
+
+ /// Returns the backend implementation class for `List`. This is the
+ /// `JSArray` class.
+ ClassEntity get listClass;
+
+ /// Returns the backend dummy class used to track mutable implementations of
+ /// `List` in type masks. This is the `JSMutableArray` class.
+ ClassEntity get mutableListClass;
+
+ /// Returns the backend dummy class used to track growable implementations of
+ /// `List` in type masks. This is the `JSExtendableArray` class.
+ ClassEntity get growableListClass;
+
+ /// Returns the backend dummy class used to track fixed-sized implementations
+ /// of `List` in type masks. This is the `JSFixedArray` class.
+ ClassEntity get fixedListClass;
+
+ /// Returns the backend dummy class used to track unmodifiable (constant)
+ /// implementations of `List` in type masks. This is the `JSUnmodifiableArray`
+ /// class.
+ ClassEntity get constListClass;
+
+ /// Returns the backend implementation class for map literals. This is the
+ /// `LinkedHashMap` class.
+ ClassEntity get mapClass;
+
+ /// Returns the backend superclass for implementations of constant map
+ /// literals. This is the `ConstantMap` class.
+ ClassEntity get constMapClass;
+
+ /// Returns the backend implementation class for `Function`. This is the
+ /// `Function` class from 'dart:core'.
+ ClassEntity get functionClass;
+
+ /// Returns the backend implementation class for `Type`. This is the
+ /// `TypeImpl` class.
+ ClassEntity get typeClass;
+
+ /// Returns the type of the implementation class for `Type`.
+ InterfaceType get typeType;
+
+ /// Returns the backend implementation class for `bool`. This is the `JSBool`
+ /// class.
+ ClassEntity get boolClass;
+
+ /// Returns the backend implementation class for `null`. This is the `JSNull`
+ /// class.
+ ClassEntity get nullClass;
+
+ /// Returns the backend dummy class used to track unsigned 32-bit integer
+ /// values in type masks. This is the `JSUint32` class.
+ ClassEntity get uint32Class;
+
+ /// Returns the backend dummy class used to track unsigned 31-bit integer
+ /// values in type masks. This is the `JSUint31` class.
+ ClassEntity get uint31Class;
+
+ /// Returns the backend dummy class used to track position values in type
+ /// masks. This is the `JSPositiveInt` class.
+ ClassEntity get positiveIntClass;
+
+ /// Returns the backend implementation class for the `Iterable` used in
+ /// `sync*` methods. This is the `_SyncStarIterable` class in dart:async.
+ ClassEntity get syncStarIterableClass;
+
+ /// Returns the backend implementation class for the `Future` used in
+ /// `async` methods. This is the `_Future` class in dart:async.
+ ClassEntity get asyncFutureClass;
+
+ /// Returns the backend implementation class for the `Stream` used in
+ /// `async*` methods. This is the `_ControllerStream` class in dart:async.
+ ClassEntity get asyncStarStreamClass;
+
+ /// Returns the backend superclass directly indexable class, that is classes
+ /// that natively support the `[]` operator. This is the `JSIndexable` class.
+ ClassEntity get indexableClass;
+
+ /// Returns the backend superclass directly indexable class, that is classes
+ /// that natively support the `[]=` operator. This is the `JSMutableIndexable`
+ /// class.
+ ClassEntity get mutableIndexableClass;
+
+ /// Returns the backend class used to mark native classes that support integer
+ /// indexing, that is `[]` and `[]=` where the key is an integer. This is the
+ /// `JavaScriptIndexingBehavior` class.
+ ClassEntity get indexingBehaviorClass;
+
+ /// Returns the backend superclass for all intercepted classes. This is the
+ /// `Interceptor` class.
+ ClassEntity get interceptorClass;
+
+ /// Returns `true` if [element] is a default implementation of `Object.==`.
+ /// This either `Object.==`, `Intercepter.==` or `Null.==`.
+ bool isDefaultEqualityImplementation(MemberEntity element);
+
+ /// Returns `true` if [cls] is an intercepted class.
+ // TODO(johnniwinther): Rename this to `isInterceptedClass`.
+ bool isInterceptorClass(ClassEntity cls);
+
+ /// Returns `true` if [cls] is a native class.
+ bool isNativeClass(ClassEntity element);
+
+ /// Returns `true` if [element] is a native member of a native class.
+ bool isNativeMember(MemberEntity element);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698