| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * Documentation wanted -- johnniwinther | 116 * Documentation wanted -- johnniwinther |
| 117 */ | 117 */ |
| 118 void processInstantiatedClassMember(ClassElement cls, Element member) { | 118 void processInstantiatedClassMember(ClassElement cls, Element member) { |
| 119 assert(invariant(member, member.isDeclaration)); | 119 assert(invariant(member, member.isDeclaration)); |
| 120 if (isProcessed(member)) return; | 120 if (isProcessed(member)) return; |
| 121 if (!member.isInstanceMember()) return; | 121 if (!member.isInstanceMember()) return; |
| 122 if (member.isField()) { | 122 if (member.isField()) { |
| 123 // Native fields need to go into instanceMembersByName as they are virtual | 123 // Fields are implicitly used by the constructor of the |
| 124 // instantiation points and escape points. | 124 // instantiated class they are part of. |
| 125 // Test the enclosing class, since the metadata has not been parsed yet. | 125 compiler.world.registerUsedElement(member); |
| 126 // Native fields need to go into instanceMembersByName as they |
| 127 // are virtual instantiation points and escape points. Test the |
| 128 // enclosing class, since the metadata has not been parsed yet. |
| 126 if (!member.enclosingElement.isNative()) return; | 129 if (!member.enclosingElement.isNative()) return; |
| 127 } | 130 } |
| 128 | 131 |
| 129 String memberName = member.name.slowToString(); | 132 String memberName = member.name.slowToString(); |
| 130 | 133 |
| 131 if (member.kind == ElementKind.FUNCTION) { | 134 if (member.kind == ElementKind.FUNCTION) { |
| 132 if (member.name == Compiler.NO_SUCH_METHOD) { | 135 if (member.name == Compiler.NO_SUCH_METHOD) { |
| 133 enableNoSuchMethod(member); | 136 enableNoSuchMethod(member); |
| 134 } | 137 } |
| 135 if (universe.hasInvocation(member, compiler)) { | 138 if (universe.hasInvocation(member, compiler)) { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 while(!queue.isEmpty) { | 538 while(!queue.isEmpty) { |
| 536 // TODO(johnniwinther): Find an optimal process order for codegen. | 539 // TODO(johnniwinther): Find an optimal process order for codegen. |
| 537 f(queue.removeLast()); | 540 f(queue.removeLast()); |
| 538 } | 541 } |
| 539 } | 542 } |
| 540 | 543 |
| 541 void _logSpecificSummary(log(message)) { | 544 void _logSpecificSummary(log(message)) { |
| 542 log('Compiled ${generatedCode.length} methods.'); | 545 log('Compiled ${generatedCode.length} methods.'); |
| 543 } | 546 } |
| 544 } | 547 } |
| OLD | NEW |