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

Unified Diff: pkg/compiler/lib/src/js_backend/enqueuer.dart

Issue 2527403002: Further encapsulate Enqueuer (Closed)
Patch Set: Cleanup. Created 4 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/enqueue.dart ('k') | pkg/compiler/lib/src/universe/use.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/enqueuer.dart
diff --git a/pkg/compiler/lib/src/js_backend/enqueuer.dart b/pkg/compiler/lib/src/js_backend/enqueuer.dart
index f6712a3b5742faa41f318a66b782d3e2eb5a937b..f9c3dad063e00472a453bd7446f3ac52e2e17c2f 100644
--- a/pkg/compiler/lib/src/js_backend/enqueuer.dart
+++ b/pkg/compiler/lib/src/js_backend/enqueuer.dart
@@ -43,7 +43,7 @@ import '../util/util.dart' show Setlet;
import '../world.dart';
/// [Enqueuer] which is specific to code generation.
-class CodegenEnqueuer extends Enqueuer {
+class CodegenEnqueuer extends EnqueuerImpl {
final String name;
@deprecated
final Compiler _compiler; // TODO(ahe): Remove this dependency.
@@ -70,7 +70,7 @@ class CodegenEnqueuer extends Enqueuer {
nativeEnqueuer = compiler.backend.nativeCodegenEnqueuer(),
this.name = 'codegen enqueuer',
this._compiler = compiler {
- impactVisitor = new _EnqueuerImpactVisitor(this);
+ impactVisitor = new EnqueuerImplImpactVisitor(this);
}
CodegenWorldBuilder get universe => _universe;
@@ -376,11 +376,12 @@ class CodegenEnqueuer extends Enqueuer {
case StaticUseKind.SUPER_FIELD_SET:
case StaticUseKind.SUPER_TEAR_OFF:
case StaticUseKind.GENERAL:
+ case StaticUseKind.DIRECT_USE:
break;
case StaticUseKind.CONSTRUCTOR_INVOKE:
case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
case StaticUseKind.REDIRECTION:
- registerTypeUse(new TypeUse.instantiation(staticUse.type));
+ registerTypeUseInternal(new TypeUse.instantiation(staticUse.type));
break;
case StaticUseKind.DIRECT_INVOKE:
_registerInstanceMethod(staticUse.element);
@@ -392,6 +393,10 @@ class CodegenEnqueuer extends Enqueuer {
}
void registerTypeUse(TypeUse typeUse) {
+ strategy.processTypeUse(this, typeUse);
+ }
+
+ void registerTypeUseInternal(TypeUse typeUse) {
DartType type = typeUse.type;
switch (typeUse.kind) {
case TypeUseKind.INSTANTIATION:
@@ -535,24 +540,3 @@ void removeFromSet(Map<String, Set<Element>> map, Element element) {
if (set == null) return;
set.remove(element);
}
-
-class _EnqueuerImpactVisitor implements WorldImpactVisitor {
- final CodegenEnqueuer 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/enqueue.dart ('k') | pkg/compiler/lib/src/universe/use.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698