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

Side by Side Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1416253002: Remove requiredTypes (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/core_types.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library deferred_load; 5 library deferred_load;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'common/backend_api.dart' show 8 import 'common/backend_api.dart' show
9 Backend; 9 Backend;
10 import 'common/tasks.dart' show 10 import 'common/tasks.dart' show
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 WorldImpact worldImpact = 313 WorldImpact worldImpact =
314 compiler.resolution.getWorldImpact(analyzableElement); 314 compiler.resolution.getWorldImpact(analyzableElement);
315 elements.addAll(worldImpact.staticUses); 315 elements.addAll(worldImpact.staticUses);
316 elements.addAll(worldImpact.closures); 316 elements.addAll(worldImpact.closures);
317 for (DartType type in worldImpact.typeLiterals) { 317 for (DartType type in worldImpact.typeLiterals) {
318 if (type.isTypedef || type.isInterfaceType) { 318 if (type.isTypedef || type.isInterfaceType) {
319 elements.add(type.element); 319 elements.add(type.element);
320 } 320 }
321 } 321 }
322 for (InterfaceType type in worldImpact.instantiatedTypes) { 322 worldImpact.instantiatedTypes.forEach(collectTypeDependencies);
323 elements.add(type.element); 323 worldImpact.isChecks.forEach(collectTypeDependencies);
324 worldImpact.asCasts.forEach(collectTypeDependencies);
325 worldImpact.onCatchTypes.forEach(collectTypeDependencies);
326 if (compiler.enableTypeAssertions) {
327 worldImpact.checkedModeChecks.forEach(collectTypeDependencies);
324 } 328 }
325 329
326 TreeElements treeElements = analyzableElement.resolvedAst.elements; 330 TreeElements treeElements = analyzableElement.resolvedAst.elements;
327 assert(treeElements != null); 331 assert(treeElements != null);
328 332
329 for (DartType type in treeElements.requiredTypes) {
330 collectTypeDependencies(type);
331 }
332
333 treeElements.forEachConstantNode((Node node, _) { 333 treeElements.forEachConstantNode((Node node, _) {
334 // Explicitly depend on the backend constants. 334 // Explicitly depend on the backend constants.
335 ConstantValue value = 335 ConstantValue value =
336 backend.constants.getConstantValueForNode(node, treeElements); 336 backend.constants.getConstantValueForNode(node, treeElements);
337 if (value != null) { 337 if (value != null) {
338 // TODO(johnniwinther): Assert that all constants have values when 338 // TODO(johnniwinther): Assert that all constants have values when
339 // these are directly evaluated. 339 // these are directly evaluated.
340 constants.add(value); 340 constants.add(value);
341 } 341 }
342 }); 342 });
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 return result; 982 return result;
983 } 983 }
984 984
985 bool operator ==(other) { 985 bool operator ==(other) {
986 if (other is! _DeclaredDeferredImport) return false; 986 if (other is! _DeclaredDeferredImport) return false;
987 return declaration == other.declaration; 987 return declaration == other.declaration;
988 } 988 }
989 989
990 int get hashCode => declaration.hashCode * 17; 990 int get hashCode => declaration.hashCode * 17;
991 } 991 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/core_types.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698