| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 class EnqueueTask extends CompilerTask { | 7 class EnqueueTask extends CompilerTask { |
| 8 final ResolutionEnqueuer resolution; | 8 final ResolutionEnqueuer resolution; |
| 9 final CodegenEnqueuer codegen; | 9 final CodegenEnqueuer codegen; |
| 10 | 10 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // supertypes. | 275 // supertypes. |
| 276 cls.ensureResolved(compiler); | 276 cls.ensureResolved(compiler); |
| 277 | 277 |
| 278 void processClass(ClassElement cls) { | 278 void processClass(ClassElement cls) { |
| 279 if (seenClasses.contains(cls)) return; | 279 if (seenClasses.contains(cls)) return; |
| 280 | 280 |
| 281 seenClasses.add(cls); | 281 seenClasses.add(cls); |
| 282 cls.ensureResolved(compiler); | 282 cls.ensureResolved(compiler); |
| 283 cls.implementation.forEachMember(processInstantiatedClassMember); | 283 cls.implementation.forEachMember(processInstantiatedClassMember); |
| 284 if (isResolutionQueue) { | 284 if (isResolutionQueue) { |
| 285 // Only the resolution queue needs to operate on individual |
| 286 // fields. The codegen enqueuer inlines the potential field |
| 287 // intializations in the constructor. |
| 288 cls.implementation.forEachInstanceField((_, Element field) { |
| 289 addToWorkList(field); |
| 290 }, includeSuperAndInjectedMembers: true); |
| 285 compiler.resolver.checkClass(cls); | 291 compiler.resolver.checkClass(cls); |
| 286 } | 292 } |
| 287 } | 293 } |
| 288 processClass(cls); | 294 processClass(cls); |
| 289 for (Link<DartType> supertypes = cls.allSupertypes; | 295 for (Link<DartType> supertypes = cls.allSupertypes; |
| 290 !supertypes.isEmpty; supertypes = supertypes.tail) { | 296 !supertypes.isEmpty; supertypes = supertypes.tail) { |
| 291 processClass(supertypes.head.element); | 297 processClass(supertypes.head.element); |
| 292 } | 298 } |
| 293 }); | 299 }); |
| 294 } | 300 } |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 while(!queue.isEmpty) { | 721 while(!queue.isEmpty) { |
| 716 // TODO(johnniwinther): Find an optimal process order for codegen. | 722 // TODO(johnniwinther): Find an optimal process order for codegen. |
| 717 f(queue.removeLast()); | 723 f(queue.removeLast()); |
| 718 } | 724 } |
| 719 } | 725 } |
| 720 | 726 |
| 721 void _logSpecificSummary(log(message)) { | 727 void _logSpecificSummary(log(message)) { |
| 722 log('Compiled ${generatedCode.length} methods.'); | 728 log('Compiled ${generatedCode.length} methods.'); |
| 723 } | 729 } |
| 724 } | 730 } |
| OLD | NEW |