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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 bool isProcessed(Element member); | 98 bool isProcessed(Element member); |
99 | 99 |
100 /** | 100 /** |
101 * Documentation wanted -- johnniwinther | 101 * Documentation wanted -- johnniwinther |
102 * | 102 * |
103 * Invariant: [element] must be a declaration element. | 103 * Invariant: [element] must be a declaration element. |
104 */ | 104 */ |
105 void addToWorkList(Element element) { | 105 void addToWorkList(Element element) { |
106 assert(invariant(element, element.isDeclaration)); | 106 assert(invariant(element, element.isDeclaration)); |
107 if (element.isForeign(compiler)) return; | 107 if (element.isForeign(compiler)) return; |
108 | |
109 if (element.isForwardingConstructor) { | |
110 addToWorkList(element.targetConstructor); | |
111 return; | |
112 } | |
113 | |
114 internalAddToWorkList(element); | 108 internalAddToWorkList(element); |
115 } | 109 } |
116 | 110 |
117 /** | 111 /** |
118 * Adds [element] to the work list if it has not already been processed. | 112 * Adds [element] to the work list if it has not already been processed. |
119 */ | 113 */ |
120 void internalAddToWorkList(Element element); | 114 void internalAddToWorkList(Element element); |
121 | 115 |
122 void registerInstantiatedType(InterfaceType type, TreeElements elements) { | 116 void registerInstantiatedType(InterfaceType type, TreeElements elements) { |
123 ClassElement cls = type.element; | 117 ClassElement cls = type.element; |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 while(!queue.isEmpty) { | 723 while(!queue.isEmpty) { |
730 // TODO(johnniwinther): Find an optimal process order for codegen. | 724 // TODO(johnniwinther): Find an optimal process order for codegen. |
731 f(queue.removeLast()); | 725 f(queue.removeLast()); |
732 } | 726 } |
733 } | 727 } |
734 | 728 |
735 void _logSpecificSummary(log(message)) { | 729 void _logSpecificSummary(log(message)) { |
736 log('Compiled ${generatedCode.length} methods.'); | 730 log('Compiled ${generatedCode.length} methods.'); |
737 } | 731 } |
738 } | 732 } |
OLD | NEW |