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

Unified Diff: pkg/compiler/lib/src/universe/world_builder.dart

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased 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 | « pkg/compiler/lib/src/universe/use.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/world_builder.dart
diff --git a/pkg/compiler/lib/src/universe/world_builder.dart b/pkg/compiler/lib/src/universe/world_builder.dart
index 088c27d3c8f0d421cd61f73274c27d60b2c7d3ee..9ae7a13b0ac2918a0b22055a555ef4e780747d65 100644
--- a/pkg/compiler/lib/src/universe/world_builder.dart
+++ b/pkg/compiler/lib/src/universe/world_builder.dart
@@ -157,16 +157,16 @@ abstract class WorldBuilder {
Iterable<ClassElement> get directlyInstantiatedClasses;
/// All types that are checked either through is, as or checked mode checks.
- Iterable<DartType> get isChecks;
+ Iterable<ResolutionDartType> get isChecks;
/// Registers that [type] is checked in this universe. The unaliased type is
/// returned.
- DartType registerIsCheck(DartType type);
+ ResolutionDartType registerIsCheck(ResolutionDartType type);
/// All directly instantiated types, that is, the types of the directly
/// instantiated classes.
// TODO(johnniwinther): Improve semantic precision.
- Iterable<DartType> get instantiatedTypes;
+ Iterable<ResolutionDartType> get instantiatedTypes;
}
abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld {
@@ -214,7 +214,7 @@ abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld {
/// The type and kind of an instantiation registered through
/// `ResolutionWorldBuilder.registerTypeInstantiation`.
class Instance {
- final InterfaceType type;
+ final ResolutionInterfaceType type;
final Instantiation kind;
final bool isRedirection;
@@ -315,8 +315,8 @@ class InstantiationInfo {
Map<ConstructorElement, Set<Instance>> instantiationMap;
/// Register [type] as the instantiation [kind] using [constructor].
- void addInstantiation(
- ConstructorElement constructor, InterfaceType type, Instantiation kind,
+ void addInstantiation(ConstructorElement constructor,
+ ResolutionInterfaceType type, Instantiation kind,
{bool isRedirection: false}) {
instantiationMap ??= <ConstructorElement, Set<Instance>>{};
instantiationMap
@@ -423,7 +423,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
/// Fields set.
final Set<Element> fieldSetters = new Set<Element>();
- final Set<DartType> isChecks = new Set<DartType>();
+ final Set<ResolutionDartType> isChecks = new Set<ResolutionDartType>();
/**
* Set of (live) [:call:] methods whose signatures reference type variables.
@@ -526,8 +526,8 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
///
/// See [directlyInstantiatedClasses].
// TODO(johnniwinther): Improve semantic precision.
- Iterable<DartType> get instantiatedTypes {
- Set<InterfaceType> types = new Set<InterfaceType>();
+ Iterable<ResolutionDartType> get instantiatedTypes {
+ Set<ResolutionInterfaceType> types = new Set<ResolutionInterfaceType>();
getInstantiationMap().forEach((_, InstantiationInfo info) {
if (info.instantiationMap != null) {
for (Set<Instance> instances in info.instantiationMap.values) {
@@ -556,7 +556,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
// subclass and through subtype instantiated types/classes.
// TODO(johnniwinther): Support unknown type arguments for generic types.
void registerTypeInstantiation(
- InterfaceType type, ClassUsedCallback classUsed,
+ ResolutionInterfaceType type, ClassUsedCallback classUsed,
{ConstructorElement constructor,
bool byMirrors: false,
bool isRedirection: false}) {
@@ -590,7 +590,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
// instead.
if (_implementedClasses.add(cls)) {
classUsed(cls, _getClassUsage(cls).implement());
- cls.allSupertypes.forEach((InterfaceType supertype) {
+ cls.allSupertypes.forEach((ResolutionInterfaceType supertype) {
if (_implementedClasses.add(supertype.element)) {
classUsed(
supertype.element, _getClassUsage(supertype.element).implement());
@@ -645,7 +645,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
.addInstantiation(constructor, instance.type, instance.kind);
} else {
ConstructorElement target = constructor.effectiveTarget;
- InterfaceType targetType =
+ ResolutionInterfaceType targetType =
constructor.computeEffectiveTargetType(instance.type);
Instantiation kind = Instantiation.DIRECTLY_INSTANTIATED;
if (target.enclosingClass.isAbstract) {
@@ -725,7 +725,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
return constraints.addReceiverConstraint(mask);
}
- DartType registerIsCheck(DartType type) {
+ ResolutionDartType registerIsCheck(ResolutionDartType type) {
type.computeUnaliased(_resolution);
type = type.unaliased;
// Even in checked mode, type annotations for return type and argument
@@ -977,7 +977,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
ClassHierarchyNode node = _ensureClassHierarchyNode(cls);
ClassSet classSet = new ClassSet(node);
- for (InterfaceType type in cls.allSupertypes) {
+ for (ResolutionInterfaceType type in cls.allSupertypes) {
// TODO(johnniwinther): Optimization: Avoid adding [cls] to
// superclasses.
ClassSet subtypeSet = _ensureClassSet(type.element);
@@ -1052,7 +1052,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
Set<Element> typesImplementedBySubclassesOfCls =
typesImplementedBySubclasses.putIfAbsent(
superclass, () => new Set<ClassElement>());
- for (DartType current in cls.allSupertypes) {
+ for (ResolutionDartType current in cls.allSupertypes) {
typesImplementedBySubclassesOfCls.add(current.element);
}
superclass = superclass.superclass;
@@ -1160,7 +1160,8 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
/// directly instantiated classes.
///
/// See [_directlyInstantiatedClasses].
- final Set<DartType> _instantiatedTypes = new Set<DartType>();
+ final Set<ResolutionDartType> _instantiatedTypes =
+ new Set<ResolutionDartType>();
/// Classes implemented by directly instantiated classes.
final Set<ClassElement> _implementedClasses = new Set<ClassElement>();
@@ -1207,7 +1208,7 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
final Map<String, Set<_MemberUsage>> _instanceFunctionsByName =
<String, Set<_MemberUsage>>{};
- final Set<DartType> isChecks = new Set<DartType>();
+ final Set<ResolutionDartType> isChecks = new Set<ResolutionDartType>();
final SelectorConstraintsStrategy selectorConstraintsStrategy;
@@ -1249,7 +1250,7 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
///
/// See [directlyInstantiatedClasses].
// TODO(johnniwinther): Improve semantic precision.
- Iterable<DartType> get instantiatedTypes => _instantiatedTypes;
+ Iterable<ResolutionDartType> get instantiatedTypes => _instantiatedTypes;
/// Register [type] as (directly) instantiated.
///
@@ -1258,7 +1259,7 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
// subclass and through subtype instantiated types/classes.
// TODO(johnniwinther): Support unknown type arguments for generic types.
void registerTypeInstantiation(
- InterfaceType type, ClassUsedCallback classUsed,
+ ResolutionInterfaceType type, ClassUsedCallback classUsed,
{bool byMirrors: false}) {
ClassElement cls = type.element;
bool isNative = _backend.isNative(cls);
@@ -1283,7 +1284,7 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
// include the type arguments.
if (_implementedClasses.add(cls)) {
classUsed(cls, _getClassUsage(cls).implement());
- cls.allSupertypes.forEach((InterfaceType supertype) {
+ cls.allSupertypes.forEach((ResolutionInterfaceType supertype) {
if (_implementedClasses.add(supertype.element)) {
classUsed(
supertype.element, _getClassUsage(supertype.element).implement());
@@ -1406,7 +1407,7 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
_invokedSetters.forEach(f);
}
- DartType registerIsCheck(DartType type) {
+ ResolutionDartType registerIsCheck(ResolutionDartType type) {
type = type.unaliased;
// Even in checked mode, type annotations for return type and argument
// types do not imply type checks, so there should never be a check
« no previous file with comments | « pkg/compiler/lib/src/universe/use.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698