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

Unified Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1019923005: Dart2js deferred loading. Follow types of functions when calculating dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Responding to review + Adding a computeSignature call. Created 5 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 | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index 00eaf84cfec2ddc8f0635e4c5f21f92f4970a60f..4b13bbfc8e019b3ae5834789ac058d138749b2f9 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -38,6 +38,8 @@ import 'elements/elements.dart' show
TypedefElement,
VoidElement;
+import 'dart_types.dart';
+
import 'util/util.dart' show
Link, makeUnique;
import 'util/uri_extras.dart' as uri_extras;
@@ -301,6 +303,31 @@ class DeferredLoadTask extends CompilerTask {
addConstants(constant.value);
}
}
+
+ collectTypeDependencies(DartType type) {
+ if (type is FunctionType) {
+ for (DartType argumentType in type.parameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ for (DartType argumentType in type.optionalParameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ for (DartType argumentType in type.namedParameterTypes) {
+ collectTypeDependencies(argumentType);
+ }
+ collectTypeDependencies(type.returnType);
+ } else if (type is TypedefType) {
+ elements.add(type.element);
+ collectTypeDependencies(type.unalias(compiler));
karlklose 2015/04/13 15:54:10 Is there a test that caught this missing registrat
sigurdm 2015/04/14 11:26:35 Done.
+ } else if (type is InterfaceType) {
+ elements.add(type.element);
+ }
+ }
+
+ if (element is FunctionElement) {
+ collectTypeDependencies(element.type);
+ }
+
if (element.isClass) {
// If we see a class, add everything its live instance members refer
// to. Static members are not relevant, unless we are processing
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698