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

Unified Diff: dart/lib/compiler/implementation/enqueue.dart

Issue 10408059: Move registering to the enqueuer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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
Index: dart/lib/compiler/implementation/enqueue.dart
diff --git a/dart/lib/compiler/implementation/enqueue.dart b/dart/lib/compiler/implementation/enqueue.dart
index e5dacb087871b018ddbfd3cbf58ceb98332b8f8b..855c539fa1d4a28b9b0a875062deca3965ceb5cf 100644
--- a/dart/lib/compiler/implementation/enqueue.dart
+++ b/dart/lib/compiler/implementation/enqueue.dart
@@ -37,7 +37,7 @@ class Enqueuer {
compiler.internalErrorOnElement(element, "Work list is closed.");
}
if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
- compiler.registerInstantiatedClass(element.enclosingElement);
+ registerInstantiatedClass(element.enclosingElement);
}
queue.add(new WorkItem(element, elements));
}
@@ -77,8 +77,7 @@ class Enqueuer {
Set<Selector> invokedSelectors = universe.invokedNames[name];
if (invokedSelectors != null) {
for (Selector selector in invokedSelectors) {
- compiler.registerDynamicInvocation(Namer.CLOSURE_INVOCATION_NAME,
- selector);
+ registerDynamicInvocation(Namer.CLOSURE_INVOCATION_NAME, selector);
}
}
}
@@ -114,7 +113,7 @@ class Enqueuer {
// We will emit a closure, so make sure the closure class is
// generated.
compiler.closureClass.ensureResolved(compiler);
- compiler.registerInstantiatedClass(compiler.closureClass);
+ registerInstantiatedClass(compiler.closureClass);
return addToWorkList(member);
}
} else if (member.kind == ElementKind.GETTER) {
@@ -197,4 +196,35 @@ class Enqueuer {
return false;
});
}
+
+ void registerStaticUse(Element element) {
+ addToWorkList(element);
+ }
+
+ void registerGetOfStaticFunction(FunctionElement element) {
+ registerStaticUse(element);
+ universe.staticFunctionsNeedingGetter.add(element);
+ }
+
+ void registerDynamicInvocation(SourceString methodName, Selector selector) {
+ assert(selector !== null);
+ registerInvocation(methodName, selector);
+ }
+
+ void registerDynamicInvocationOf(Element element) {
+ addToWorkList(element);
+ }
+
+ void registerDynamicGetter(SourceString methodName, Selector selector) {
+ registerGetter(methodName, selector);
+ }
+
+ void registerDynamicSetter(SourceString methodName, Selector selector) {
+ registerSetter(methodName, selector);
+ }
+
+ // TODO(ngeoffray): This should get a type.
+ void registerIsCheck(Element element) {
+ universe.isChecks.add(element);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698