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

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

Issue 1467733002: Revert "Remove WorldImpact from caches when no longer needed." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dump_info.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 f5614d97e15d7437769ce86ec388851b04d1870f..78c0a37a05d5c7751b1355935c7dc62d2aafae28 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -28,7 +28,6 @@ import 'elements/elements.dart' show
FunctionElement,
ImportElement,
LibraryElement,
- LocalFunctionElement,
MetadataAnnotation,
PrefixElement,
ScopeContainerElement,
@@ -49,14 +48,11 @@ import 'tree/tree.dart' show
NewExpression,
Node;
import 'universe/use.dart' show
- DynamicUse,
StaticUse,
TypeUse,
TypeUseKind;
import 'universe/world_impact.dart' show
- ImpactUseCase,
- WorldImpact,
- WorldImpactVisitorImpl;
+ WorldImpact;
import 'util/setlet.dart' show
Setlet;
import 'util/uri_extras.dart' as uri_extras;
@@ -126,8 +122,6 @@ class DeferredLoadTask extends CompilerTask {
/// Will be `true` if the program contains deferred libraries.
bool isProgramSplit = false;
- static const ImpactUseCase IMPACT_USE = const ImpactUseCase('Deferred load');
-
/// A mapping from the name of a defer import to all the output units it
/// depends on in a list of lists to be loaded in the order they appear.
///
@@ -324,35 +318,30 @@ class DeferredLoadTask extends CompilerTask {
WorldImpact worldImpact =
compiler.resolution.getWorldImpact(analyzableElement);
- compiler.impactStrategy.visitImpact(
- analyzableElement,
- worldImpact,
- new WorldImpactVisitorImpl(
- visitStaticUse: (StaticUse staticUse) {
- elements.add(staticUse.element);
- },
- visitTypeUse: (TypeUse typeUse) {
- DartType type = typeUse.type;
- switch (typeUse.kind) {
- case TypeUseKind.TYPE_LITERAL:
- if (type.isTypedef || type.isInterfaceType) {
- elements.add(type.element);
- }
- break;
- case TypeUseKind.INSTANTIATION:
- case TypeUseKind.IS_CHECK:
- case TypeUseKind.AS_CAST:
- case TypeUseKind.CATCH_TYPE:
- collectTypeDependencies(type);
- break;
- case TypeUseKind.CHECKED_MODE_CHECK:
- if (compiler.enableTypeAssertions) {
- collectTypeDependencies(type);
- }
- break;
- }
- }),
- IMPACT_USE);
+ worldImpact.staticUses.forEach((StaticUse staticUse) {
+ elements.add(staticUse.element);
+ });
+ for (TypeUse typeUse in worldImpact.typeUses) {
+ DartType type = typeUse.type;
+ switch (typeUse.kind) {
+ case TypeUseKind.TYPE_LITERAL:
+ if (type.isTypedef || type.isInterfaceType) {
+ elements.add(type.element);
+ }
+ break;
+ case TypeUseKind.INSTANTIATION:
+ case TypeUseKind.IS_CHECK:
+ case TypeUseKind.AS_CAST:
+ case TypeUseKind.CATCH_TYPE:
+ collectTypeDependencies(type);
+ break;
+ case TypeUseKind.CHECKED_MODE_CHECK:
+ if (compiler.enableTypeAssertions) {
+ collectTypeDependencies(type);
+ }
+ break;
+ }
+ }
TreeElements treeElements = analyzableElement.resolvedAst.elements;
assert(treeElements != null);
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dump_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698