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

Unified Diff: pkg/compiler/lib/src/common/registry.dart

Issue 2359923002: Revert "Move towards using WorldImpact for codegen" (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/registry.dart
diff --git a/pkg/compiler/lib/src/common/registry.dart b/pkg/compiler/lib/src/common/registry.dart
index 08d6081c5d850e8e5c6cad0e8b9b3288e662b6b0..96ee8453d6bd057247cf62e9c6aa29dcd92fba51 100644
--- a/pkg/compiler/lib/src/common/registry.dart
+++ b/pkg/compiler/lib/src/common/registry.dart
@@ -4,10 +4,48 @@
library dart2js.common.registry;
+import '../dart_types.dart' show InterfaceType;
import '../elements/elements.dart' show Element;
+import '../enqueue.dart' show Enqueuer;
+import '../universe/use.dart' show DynamicUse, StaticUse;
-// TODO(johnniwinther): Remove this.
/// Interface for registration of element dependencies.
abstract class Registry {
+ // TODO(johnniwinther): Remove this.
void registerDependency(Element element) {}
+
+ bool get isForResolution;
+
+ void registerDynamicUse(DynamicUse staticUse);
+
+ void registerStaticUse(StaticUse staticUse);
+
+ void registerInstantiation(InterfaceType type);
+}
+
+// TODO(johnniwinther): Remove this.
+class EagerRegistry extends Registry {
+ final String name;
+ final Enqueuer world;
+
+ EagerRegistry(this.name, this.world);
+
+ bool get isForResolution => world.isResolutionQueue;
+
+ @override
+ void registerDynamicUse(DynamicUse dynamicUse) {
+ world.registerDynamicUse(dynamicUse);
+ }
+
+ @override
+ void registerInstantiation(InterfaceType type) {
+ world.registerInstantiatedType(type);
+ }
+
+ @override
+ void registerStaticUse(StaticUse staticUse) {
+ world.registerStaticUse(staticUse);
+ }
+
+ String toString() => name;
}
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698