Chromium Code Reviews| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * Documentation wanted -- johnniwinther | 54 * Documentation wanted -- johnniwinther |
| 55 * | 55 * |
| 56 * Invariant: [element] must be a declaration element. | 56 * Invariant: [element] must be a declaration element. |
| 57 */ | 57 */ |
| 58 void addToWorkList(Element element, [TreeElements elements]) { | 58 void addToWorkList(Element element, [TreeElements elements]) { |
| 59 assert(invariant(element, element.isDeclaration)); | 59 assert(invariant(element, element.isDeclaration)); |
| 60 if (element.isForeign(compiler)) return; | 60 if (element.isForeign(compiler)) return; |
| 61 | 61 |
| 62 if (element is ForwardingConstructorElement) { | |
|
ahe
2013/04/15 13:36:46
Can you call a method instead?
| |
| 63 addToWorkList(element.superConstructor, elements); | |
| 64 return; | |
| 65 } | |
| 66 | |
| 62 if (!addElementToWorkList(element, elements)) return; | 67 if (!addElementToWorkList(element, elements)) return; |
| 63 | 68 |
| 64 // Enable runtime type support if we discover a getter called runtimeType. | 69 // Enable runtime type support if we discover a getter called runtimeType. |
| 65 // We have to enable runtime type before hitting the codegen, so | 70 // We have to enable runtime type before hitting the codegen, so |
| 66 // that constructors know whether they need to generate code for | 71 // that constructors know whether they need to generate code for |
| 67 // runtime type. | 72 // runtime type. |
| 68 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { | 73 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { |
| 69 compiler.enabledRuntimeType = true; | 74 compiler.enabledRuntimeType = true; |
| 70 // TODO(ahe): Record precise dependency here. | 75 // TODO(ahe): Record precise dependency here. |
| 71 compiler.backend.registerRuntimeType(compiler.globalDependencies); | 76 compiler.backend.registerRuntimeType(compiler.globalDependencies); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 while(!queue.isEmpty) { | 607 while(!queue.isEmpty) { |
| 603 // TODO(johnniwinther): Find an optimal process order for codegen. | 608 // TODO(johnniwinther): Find an optimal process order for codegen. |
| 604 f(queue.removeLast()); | 609 f(queue.removeLast()); |
| 605 } | 610 } |
| 606 } | 611 } |
| 607 | 612 |
| 608 void _logSpecificSummary(log(message)) { | 613 void _logSpecificSummary(log(message)) { |
| 609 log('Compiled ${generatedCode.length} methods.'); | 614 log('Compiled ${generatedCode.length} methods.'); |
| 610 } | 615 } |
| 611 } | 616 } |
| OLD | NEW |