| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 } else if (member.kind === ElementKind.SETTER) { | 213 } else if (member.kind === ElementKind.SETTER) { |
| 214 if (universe.hasInvokedSetter(member, compiler)) { | 214 if (universe.hasInvokedSetter(member, compiler)) { |
| 215 return addToWorkList(member); | 215 return addToWorkList(member); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 void onRegisterInstantiatedClass(ClassElement cls) { | 220 void onRegisterInstantiatedClass(ClassElement cls) { |
| 221 task.measure(() { | 221 task.measure(() { |
| 222 while (cls !== null) { | 222 // The class must be resolved to compute the set of all |
| 223 if (seenClasses.contains(cls)) return; | 223 // supertypes. |
| 224 cls.ensureResolved(compiler); |
| 225 |
| 226 for (Link<Type> supertypes = cls.allSupertypesAndSelf; |
| 227 !supertypes.isEmpty(); supertypes = supertypes.tail) { |
| 228 cls = supertypes.head.element; |
| 229 if (seenClasses.contains(cls)) continue; |
| 224 seenClasses.add(cls); | 230 seenClasses.add(cls); |
| 225 cls.ensureResolved(compiler); | 231 cls.ensureResolved(compiler); |
| 226 cls.localMembers.forEach(processInstantiatedClassMember); | 232 if (!cls.isInterface()) { |
| 227 cls = cls.superclass; | 233 cls.localMembers.forEach(processInstantiatedClassMember); |
| 234 } |
| 235 if (isResolutionQueue) { |
| 236 compiler.resolver.checkMembers(cls); |
| 237 } |
| 228 } | 238 } |
| 229 }); | 239 }); |
| 230 } | 240 } |
| 231 | 241 |
| 232 void registerNewSelector(SourceString name, | 242 void registerNewSelector(SourceString name, |
| 233 Selector selector, | 243 Selector selector, |
| 234 Map<SourceString, Set<Selector>> selectorsMap) { | 244 Map<SourceString, Set<Selector>> selectorsMap) { |
| 235 if (name != selector.name) { | 245 if (name != selector.name) { |
| 236 String message = "$name != ${selector.name} (${selector.kind})"; | 246 String message = "$name != ${selector.name} (${selector.kind})"; |
| 237 compiler.internalError("Wrong selector name: $message."); | 247 compiler.internalError("Wrong selector name: $message."); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 void forEach(f(WorkItem work)) { | 350 void forEach(f(WorkItem work)) { |
| 341 while (!queue.isEmpty()) { | 351 while (!queue.isEmpty()) { |
| 342 do { | 352 do { |
| 343 f(queue.removeLast()); | 353 f(queue.removeLast()); |
| 344 } while (!queue.isEmpty()); | 354 } while (!queue.isEmpty()); |
| 345 // TODO(ahe): we shouldn't register the field closure invocations here. | 355 // TODO(ahe): we shouldn't register the field closure invocations here. |
| 346 registerFieldClosureInvocations(); | 356 registerFieldClosureInvocations(); |
| 347 } | 357 } |
| 348 } | 358 } |
| 349 } | 359 } |
| OLD | NEW |