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

Unified Diff: sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 148513007: Revert "Deferred loading: handle type arguments of superclasses." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/deferred_type_arguments_test1.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/deferred_load.dart
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index 5fa0cb4ab9395a7468368804ba746c777757acf4..8c0907ee4c7aed84332723010f57b57433b2b533 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -46,15 +46,6 @@ import 'mirrors_used.dart' show
MirrorUsageAnalyzerTask,
MirrorUsage;
-import "dart_types.dart" show
- DartType,
- VoidType,
- InterfaceType,
- FunctionType,
- TypeVariableType,
- MalformedType,
- TypedefType;
-
/// A "hunk" of the program that will be loaded whenever one of its [imports]
/// are loaded.
///
@@ -141,9 +132,6 @@ class DeferredLoadTask extends CompilerTask {
Map<Import, Set<Element>> _importedDeferredBy = null;
Map<Import, Set<Constant>> _constantsDeferredBy = null;
- // The types we have visited in [addNestedTypes].
- Set<DartType> _visitedTypes;
-
Set<Element> _mainElements = new Set<Element>();
DeferredLoadTask(Compiler compiler) : super(compiler);
@@ -300,42 +288,9 @@ class DeferredLoadTask extends CompilerTask {
_collectDependencies(e.implementation, elements, constants);
});
}
- // Adds, recursively, to [elements] any types the [type] depends on in its
- // type arguments.
- void addNestedTypes(DartType type) {
- if (_visitedTypes.contains(type)) return;
- _visitedTypes.add(type);
- // Gives a FunctionType from a TypedefType.
- type = type.unalias(compiler);
- // Only add concrete types.
- if (type is VoidType) return;
- if (type is TypeVariableType) return;
- if (type is MalformedType) return;
- if (type is FunctionType) {
- FunctionType functionType = type;
- addNestedTypes(functionType.returnType);
- for (DartType parameterType in functionType.parameterTypes) {
- addNestedTypes(parameterType);
- }
- for (DartType parameterType in functionType.optionalParameterTypes) {
- addNestedTypes(parameterType);
- }
- for (DartType parameterType in functionType.namedParameterTypes) {
- addNestedTypes(parameterType);
- }
- return;
- }
- assert(invariant(type.element, type is InterfaceType,
- message: "Unrecognized type: $type"));
- InterfaceType interfaceType = type;
- for (DartType typeArgument in interfaceType.typeArguments) {
- addNestedTypes(typeArgument);
- }
+ for (var type in cls.implementation.allSupertypes) {
elements.add(type.element.implementation);
}
- for (DartType supertype in cls.implementation.allSupertypes) {
- addNestedTypes(supertype);
- }
elements.add(cls.implementation);
} else if (Elements.isStaticOrTopLevel(element) ||
element.isConstructor()) {
@@ -602,7 +557,6 @@ class DeferredLoadTask extends CompilerTask {
_importedDeferredBy = new Map<Import, Set<Element>>();
_constantsDeferredBy = new Map<Import, Set<Constant>>();
_importedDeferredBy[_fakeMainImport] = _mainElements;
- _visitedTypes = new Set<DartType>();
measureElement(mainLibrary, () {
@@ -638,7 +592,6 @@ class DeferredLoadTask extends CompilerTask {
// Release maps;
_importedDeferredBy = null;
_constantsDeferredBy = null;
- _visitedTypes = null;
_adjustConstantsOutputUnit(allConstants);
« no previous file with comments | « no previous file | tests/compiler/dart2js/deferred_type_arguments_test1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698