| OLD | NEW |
| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 currentClass !== null; | 133 currentClass !== null; |
| 134 currentClass = currentClass.superclass) { | 134 currentClass = currentClass.superclass) { |
| 135 processInstantiatedClass(currentClass); | 135 processInstantiatedClass(currentClass); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 }); | 138 }); |
| 139 return true; | 139 return true; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void processInstantiatedClass(ClassElement cls) { | 142 void processInstantiatedClass(ClassElement cls) { |
| 143 cls.members.forEach(processInstantiatedClassMember); | 143 cls.localMembers.forEach(processInstantiatedClassMember); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void registerFieldClosureInvocations() { | 146 void registerFieldClosureInvocations() { |
| 147 task.measure(() { | 147 task.measure(() { |
| 148 // Make sure that the closure understands a call with the given | 148 // Make sure that the closure understands a call with the given |
| 149 // selector. For a method-invocation of the form o.foo(a: 499), we | 149 // selector. For a method-invocation of the form o.foo(a: 499), we |
| 150 // need to make sure that closures can handle the optional argument if | 150 // need to make sure that closures can handle the optional argument if |
| 151 // there exists a field or getter 'foo'. | 151 // there exists a field or getter 'foo'. |
| 152 var names = universe.instantiatedClassInstanceFields; | 152 var names = universe.instantiatedClassInstanceFields; |
| 153 // TODO(ahe): Might be enough to use invokedGetters. | 153 // TODO(ahe): Might be enough to use invokedGetters. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 void onRegisterInstantiatedClass(ClassElement cls) { | 215 void onRegisterInstantiatedClass(ClassElement cls) { |
| 216 task.measure(() { | 216 task.measure(() { |
| 217 while (cls !== null) { | 217 while (cls !== null) { |
| 218 if (seenClasses.contains(cls)) return; | 218 if (seenClasses.contains(cls)) return; |
| 219 seenClasses.add(cls); | 219 seenClasses.add(cls); |
| 220 cls.ensureResolved(compiler); | 220 cls.ensureResolved(compiler); |
| 221 cls.members.forEach(processInstantiatedClassMember); | 221 cls.localMembers.forEach(processInstantiatedClassMember); |
| 222 cls = cls.superclass; | 222 cls = cls.superclass; |
| 223 } | 223 } |
| 224 }); | 224 }); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void registerNewSelector(SourceString name, | 227 void registerNewSelector(SourceString name, |
| 228 Selector selector, | 228 Selector selector, |
| 229 Map<SourceString, Set<Selector>> selectorsMap) { | 229 Map<SourceString, Set<Selector>> selectorsMap) { |
| 230 Set<Selector> selectors = | 230 Set<Selector> selectors = |
| 231 selectorsMap.putIfAbsent(name, () => new Set<Selector>()); | 231 selectorsMap.putIfAbsent(name, () => new Set<Selector>()); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 void forEach(f(WorkItem work)) { | 325 void forEach(f(WorkItem work)) { |
| 326 while (!queue.isEmpty()) { | 326 while (!queue.isEmpty()) { |
| 327 do { | 327 do { |
| 328 f(queue.removeLast()); | 328 f(queue.removeLast()); |
| 329 } while (!queue.isEmpty()); | 329 } while (!queue.isEmpty()); |
| 330 // TODO(ahe): we shouldn't register the field closure invocations here. | 330 // TODO(ahe): we shouldn't register the field closure invocations here. |
| 331 registerFieldClosureInvocations(); | 331 registerFieldClosureInvocations(); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 } | 334 } |
| OLD | NEW |