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

Side by Side Diff: lib/compiler/implementation/enqueue.dart

Issue 10832203: Refactor Library/CompilationUnit and how we define local Scope. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and refactor ClassElement.constructors. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class EnqueueTask extends CompilerTask { 5 class EnqueueTask extends CompilerTask {
6 final Enqueuer codegen; 6 final Enqueuer codegen;
7 final Enqueuer resolution; 7 final Enqueuer resolution;
8 8
9 String get name() => 'Enqueue'; 9 String get name() => 'Enqueue';
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 currentClass !== null; 130 currentClass !== null;
131 currentClass = currentClass.superclass) { 131 currentClass = currentClass.superclass) {
132 processInstantiatedClass(currentClass); 132 processInstantiatedClass(currentClass);
133 } 133 }
134 } 134 }
135 }); 135 });
136 return true; 136 return true;
137 } 137 }
138 138
139 void processInstantiatedClass(ClassElement cls) { 139 void processInstantiatedClass(ClassElement cls) {
140 cls.members.forEach(processInstantiatedClassMember); 140 cls.localMembers.forEach(processInstantiatedClassMember);
141 } 141 }
142 142
143 void registerFieldClosureInvocations() { 143 void registerFieldClosureInvocations() {
144 task.measure(() { 144 task.measure(() {
145 // Make sure that the closure understands a call with the given 145 // Make sure that the closure understands a call with the given
146 // selector. For a method-invocation of the form o.foo(a: 499), we 146 // selector. For a method-invocation of the form o.foo(a: 499), we
147 // need to make sure that closures can handle the optional argument if 147 // need to make sure that closures can handle the optional argument if
148 // there exists a field or getter 'foo'. 148 // there exists a field or getter 'foo'.
149 var names = universe.instantiatedClassInstanceFields; 149 var names = universe.instantiatedClassInstanceFields;
150 // TODO(ahe): Might be enough to use invokedGetters. 150 // TODO(ahe): Might be enough to use invokedGetters.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 void onRegisterInstantiatedClass(ClassElement cls) { 212 void onRegisterInstantiatedClass(ClassElement cls) {
213 task.measure(() { 213 task.measure(() {
214 while (cls !== null) { 214 while (cls !== null) {
215 if (seenClasses.contains(cls)) return; 215 if (seenClasses.contains(cls)) return;
216 seenClasses.add(cls); 216 seenClasses.add(cls);
217 // TODO(ahe): Don't call resolveType, instead, call this method 217 // TODO(ahe): Don't call resolveType, instead, call this method
218 // when resolveType is called. 218 // when resolveType is called.
219 compiler.resolveClass(cls); 219 compiler.resolveClass(cls);
220 cls.members.forEach(processInstantiatedClassMember); 220 cls.localMembers.forEach(processInstantiatedClassMember);
221 cls = cls.superclass; 221 cls = cls.superclass;
222 } 222 }
223 }); 223 });
224 } 224 }
225 225
226 void registerNewSelector(SourceString name, 226 void registerNewSelector(SourceString name,
227 Selector selector, 227 Selector selector,
228 Map<SourceString, Set<Selector>> selectorsMap) { 228 Map<SourceString, Set<Selector>> selectorsMap) {
229 Set<Selector> selectors = 229 Set<Selector> selectors =
230 selectorsMap.putIfAbsent(name, () => new Set<Selector>()); 230 selectorsMap.putIfAbsent(name, () => new Set<Selector>());
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 void forEach(f(WorkItem work)) { 324 void forEach(f(WorkItem work)) {
325 while (!queue.isEmpty()) { 325 while (!queue.isEmpty()) {
326 do { 326 do {
327 f(queue.removeLast()); 327 f(queue.removeLast());
328 } while (!queue.isEmpty()); 328 } while (!queue.isEmpty());
329 // TODO(ahe): we shouldn't register the field closure invocations here. 329 // TODO(ahe): we shouldn't register the field closure invocations here.
330 registerFieldClosureInvocations(); 330 registerFieldClosureInvocations();
331 } 331 }
332 } 332 }
333 } 333 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/js_backend/native_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698