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

Unified Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 2869403002: Move ElementEnvironment.isSubtype to DartTypes (Closed)
Patch Set: Created 3 years, 7 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/native/enqueue.dart
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 4530ae522f4f2905b4cc7609a1a48de59e29b5e4..71f66c2c286d43ab1a7bbb01054ee84e8fb1faf3 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -51,11 +51,12 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
final CompilerOptions _options;
final ElementEnvironment _elementEnvironment;
+ final DartTypes _dartTypes;
final CommonElements _commonElements;
/// Subclasses of [NativeEnqueuerBase] are constructed by the backend.
- NativeEnqueuerBase(
- this._options, this._elementEnvironment, this._commonElements);
+ NativeEnqueuerBase(this._options, this._elementEnvironment,
+ this._commonElements, this._dartTypes);
bool get enableLiveTypeAnalysis => _options.enableNativeLiveTypeAnalysis;
@@ -109,7 +110,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
type == _commonElements.stringType ||
type == _commonElements.nullType ||
type == _commonElements.boolType ||
- _elementEnvironment.isSubtype(type,
+ _dartTypes.isSubtype(type,
_elementEnvironment.getRawType(_commonElements.jsArrayClass))) {
registerInstantiation(type);
}
@@ -126,7 +127,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
_elementEnvironment.getThisType(nativeClass);
InterfaceType specType =
_elementEnvironment.getThisType(type.element);
- return _elementEnvironment.isSubtype(nativeType, specType);
+ return _dartTypes.isSubtype(nativeType, specType);
}));
} else if (type.isDynamic) {
matchingClasses.addAll(_unusedClasses);
@@ -195,9 +196,10 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
CompilerOptions options,
ElementEnvironment elementEnvironment,
CommonElements commonElements,
+ DartTypes dartTypes,
this._backendUsageBuilder,
this._nativeClassFinder)
- : super(options, elementEnvironment, commonElements);
+ : super(options, elementEnvironment, commonElements, dartTypes);
Iterable<ClassEntity> get nativeClassesForTesting => _nativeClasses;
@@ -238,10 +240,11 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
CompilerOptions options,
ElementEnvironment elementEnvironment,
CommonElements commonElements,
+ DartTypes dartTypes,
this._emitter,
this._resolutionEnqueuer,
this._nativeData)
- : super(options, elementEnvironment, commonElements);
+ : super(options, elementEnvironment, commonElements, dartTypes);
WorldImpact processNativeClasses(Iterable<LibraryElement> libraries) {
WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_strategy.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698