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

Unified Diff: pkg/compiler/lib/src/enqueue.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/dump_info.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 3744f2dca440c95223549e6146cb792218090bff..53796dc0280bd5b91654605cabf17610745d66ce 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -58,9 +58,7 @@ import 'universe/use.dart' show
TypeUse,
TypeUseKind;
import 'universe/world_impact.dart' show
- ImpactUseCase,
- WorldImpact,
- WorldImpactVisitor;
+ WorldImpact;
import 'util/util.dart' show
Link,
Setlet;
@@ -119,14 +117,10 @@ abstract class Enqueuer {
bool hasEnqueuedReflectiveElements = false;
bool hasEnqueuedReflectiveStaticFields = false;
- WorldImpactVisitor impactVisitor;
-
Enqueuer(this.name,
this.compiler,
this.itemCompilationContextCreator,
- this.strategy) {
- impactVisitor = new _EnqueuerImpactVisitor(this);
- }
+ this.strategy);
// TODO(johnniwinther): Move this to [ResolutionEnqueuer].
Resolution get resolution => compiler.resolution;
@@ -148,8 +142,6 @@ abstract class Enqueuer {
Iterable<ClassElement> get processedClasses => _processedClasses;
- ImpactUseCase get impactUse;
-
/**
* Documentation wanted -- johnniwinther
*
@@ -174,8 +166,10 @@ abstract class Enqueuer {
/// Apply the [worldImpact] of processing [element] to this enqueuer.
void applyImpact(Element element, WorldImpact worldImpact) {
- compiler.impactStrategy.visitImpact(
- element, worldImpact, impactVisitor, impactUse);
+ // TODO(johnniwinther): Optimize the application of the world impact.
+ worldImpact.dynamicUses.forEach(registerDynamicUse);
+ worldImpact.staticUses.forEach(registerStaticUse);
+ worldImpact.typeUses.forEach(registerTypeUse);
}
void registerInstantiatedType(InterfaceType type,
@@ -747,10 +741,6 @@ class ResolutionEnqueuer extends Enqueuer {
*/
final Queue<DeferredTask> deferredTaskQueue;
- static const ImpactUseCase IMPACT_USE = const ImpactUseCase('ResolutionEnqueuer');
-
- ImpactUseCase get impactUse => IMPACT_USE;
-
ResolutionEnqueuer(Compiler compiler,
ItemCompilationContext itemCompilationContextCreator(),
EnqueuerStrategy strategy)
@@ -906,10 +896,6 @@ class CodegenEnqueuer extends Enqueuer {
bool enabledNoSuchMethod = false;
- static const ImpactUseCase IMPACT_USE = const ImpactUseCase('CodegenEnqueuer');
-
- ImpactUseCase get impactUse => IMPACT_USE;
-
CodegenEnqueuer(Compiler compiler,
ItemCompilationContext itemCompilationContextCreator(),
EnqueuerStrategy strategy)
@@ -1053,24 +1039,3 @@ class TreeShakingEnqueuerStrategy implements EnqueuerStrategy {
enqueuer.handleUnseenSelectorInternal(dynamicUse);
}
}
-
-class _EnqueuerImpactVisitor implements WorldImpactVisitor {
- final Enqueuer enqueuer;
-
- _EnqueuerImpactVisitor(this.enqueuer);
-
- @override
- void visitDynamicUse(DynamicUse dynamicUse) {
- enqueuer.registerDynamicUse(dynamicUse);
- }
-
- @override
- void visitStaticUse(StaticUse staticUse) {
- enqueuer.registerStaticUse(staticUse);
- }
-
- @override
- void visitTypeUse(TypeUse typeUse) {
- enqueuer.registerTypeUse(typeUse);
- }
-}
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698