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

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

Issue 2021723003: Fix code-size regression (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Also handle 'dynamic'. Created 4 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e15f185cbee361d1669c4b225f0fdabedc79d9f5..f38ccc43f10663e59d0e43ec2f63206d2c9ead90 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -520,12 +520,23 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
.isSubtype(type, backend.listImplementation.rawType)) {
backend.registerInstantiatedType(type, world, registry);
}
+ // TODO(johnniwinther): Improve spec string precision to handle type
+ // arguments and implements relations that preserve generics. Currently
+ // we cannot distinguish between `List`, `List<dynamic>`, and
+ // `List<int>` and take all to mean `List<E>`; in effect not including
+ // any native subclasses of generic classes.
+ // TODO(johnniwinther,sra): Find and replace uses of `List` with the
+ // actual implementation classes such as `JSArray` et al.
+ enqueueUnusedClassesMatching((ClassElement nativeClass) {
+ InterfaceType nativeType = nativeClass.thisType;
+ InterfaceType specType = type.element.thisType;
+ return compiler.types.isSubtype(nativeType, specType);
+ }, cause, 'subtypeof($type)');
+ } else if (type.isDynamic) {
+ enqueueUnusedClassesMatching((_) => true, cause, 'subtypeof($type)');
+ } else {
+ assert(type is VoidType);
}
- assert(type is DartType);
- enqueueUnusedClassesMatching(
- (nativeClass) => compiler.types.isSubtype(nativeClass.thisType, type),
- cause,
- 'subtypeof($type)');
}
// Give an info so that library developers can compile with -v to find why
« no previous file with comments | « no previous file | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698