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

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

Issue 10854158: Make selector registration in the resolver and code generator more explicit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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: lib/compiler/implementation/enqueue.dart
diff --git a/lib/compiler/implementation/enqueue.dart b/lib/compiler/implementation/enqueue.dart
index 0dc6bf8d2a94702db757d6a86d8da619861289b1..f0b02195be9368ff8d4b266574c16cb26b59c8d2 100644
--- a/lib/compiler/implementation/enqueue.dart
+++ b/lib/compiler/implementation/enqueue.dart
@@ -143,31 +143,6 @@ class Enqueuer {
cls.localMembers.forEach(processInstantiatedClassMember);
}
- void registerFieldClosureInvocations() {
- task.measure(() {
- // Make sure that the closure understands a call with the given
- // selector. For a method-invocation of the form o.foo(a: 499), we
- // need to make sure that closures can handle the optional argument if
- // there exists a field or getter 'foo'.
- var names = universe.instantiatedClassInstanceFields;
- // TODO(ahe): Might be enough to use invokedGetters.
- for (SourceString name in names) {
- Set<Selector> invokedSelectors = universe.invokedNames[name];
- if (invokedSelectors != null) {
- for (Selector selector in invokedSelectors) {
- Selector call = new Selector.call(
- compiler.namer.CLOSURE_INVOCATION_NAME,
- selector.library, // TODO(kasperl): Use "default" library?
- selector.argumentCount,
- selector.namedArguments);
- registerDynamicInvocation(compiler.namer.CLOSURE_INVOCATION_NAME,
- call);
- }
- }
- }
- });
- }
-
void processInstantiatedClassMember(Element member) {
if (universe.generatedCode.containsKey(member)) return;
if (resolvedElements[member] !== null) return;
@@ -295,7 +270,7 @@ class Enqueuer {
}
void registerStaticUse(Element element) {
- addToWorkList(element);
+ if (element !== null) addToWorkList(element);
}
void registerGetOfStaticFunction(FunctionElement element) {
@@ -349,11 +324,7 @@ class Enqueuer {
void forEach(f(WorkItem work)) {
while (!queue.isEmpty()) {
- do {
- f(queue.removeLast());
- } while (!queue.isEmpty());
- // TODO(ahe): we shouldn't register the field closure invocations here.
- registerFieldClosureInvocations();
+ f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst?
ahe 2012/08/16 12:09:54 Main is added last and we want to process it first
}
}
}

Powered by Google App Engine
This is Rietveld 408576698