| 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 24 matching lines...) Expand all Loading... |
| 35 // TODO(ahe): Investigate what makes mixin applications crash | 35 // TODO(ahe): Investigate what makes mixin applications crash |
| 36 // this method. | 36 // this method. |
| 37 ClassElementX cls = element; | 37 ClassElementX cls = element; |
| 38 cls.ensureResolved(compiler); | 38 cls.ensureResolved(compiler); |
| 39 members = cls.localMembers; | 39 members = cls.localMembers; |
| 40 for (var link = cls.computeTypeParameters(compiler); | 40 for (var link = cls.computeTypeParameters(compiler); |
| 41 !link.isEmpty; | 41 !link.isEmpty; |
| 42 link = link.tail) { | 42 link = link.tail) { |
| 43 addMemberByName(link.head.element); | 43 addMemberByName(link.head.element); |
| 44 } | 44 } |
| 45 } else if (element.isConstructor()) { | |
| 46 SourceString source = Elements.deconstructConstructorName( | |
| 47 element.name, element.getEnclosingClass()); | |
| 48 if (source == null) { | |
| 49 // source is null for unnamed constructors. | |
| 50 name = ''; | |
| 51 } else { | |
| 52 name = source.slowToString(); | |
| 53 } | |
| 54 } | 45 } |
| 55 allElementsByName[name] = allElementsByName.putIfAbsent( | 46 allElementsByName[name] = allElementsByName.putIfAbsent( |
| 56 name, () => const Link<Element>()).prepend(element); | 47 name, () => const Link<Element>()).prepend(element); |
| 57 for (var link = members; !link.isEmpty; link = link.tail) { | 48 for (var link = members; !link.isEmpty; link = link.tail) { |
| 58 addMemberByName(link.head); | 49 addMemberByName(link.head); |
| 59 } | 50 } |
| 60 } | 51 } |
| 61 | 52 |
| 62 compiler.libraries.values.forEach(addMemberByName); | 53 compiler.libraries.values.forEach(addMemberByName); |
| 63 } | 54 } |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 while(!queue.isEmpty) { | 736 while(!queue.isEmpty) { |
| 746 // TODO(johnniwinther): Find an optimal process order for codegen. | 737 // TODO(johnniwinther): Find an optimal process order for codegen. |
| 747 f(queue.removeLast()); | 738 f(queue.removeLast()); |
| 748 } | 739 } |
| 749 } | 740 } |
| 750 | 741 |
| 751 void _logSpecificSummary(log(message)) { | 742 void _logSpecificSummary(log(message)) { |
| 752 log('Compiled ${generatedCode.length} methods.'); | 743 log('Compiled ${generatedCode.length} methods.'); |
| 753 } | 744 } |
| 754 } | 745 } |
| OLD | NEW |