| 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 typedef ItemCompilationContext ItemCompilationContextCreator(); | 7 typedef ItemCompilationContext ItemCompilationContextCreator(); |
| 8 | 8 |
| 9 class EnqueueTask extends CompilerTask { | 9 class EnqueueTask extends CompilerTask { |
| 10 final ResolutionEnqueuer resolution; | 10 final ResolutionEnqueuer resolution; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // TODO(ahe): Consider lifting this restriction. | 30 // TODO(ahe): Consider lifting this restriction. |
| 31 if (!library.isInternalLibrary) { | 31 if (!library.isInternalLibrary) { |
| 32 container = library; | 32 container = library; |
| 33 // TODO(ahe): Is this right? Is this necessary? | 33 // TODO(ahe): Is this right? Is this necessary? |
| 34 name = library.getLibraryOrScriptName(); | 34 name = library.getLibraryOrScriptName(); |
| 35 } | 35 } |
| 36 } else if (element.isClass()) { | 36 } else if (element.isClass()) { |
| 37 ClassElement cls = element; | 37 ClassElement cls = element; |
| 38 cls.ensureResolved(compiler); | 38 cls.ensureResolved(compiler); |
| 39 container = cls; | 39 container = cls; |
| 40 for (var link = cls.computeTypeParameters(compiler); | 40 for (DartType parameter in cls.computeTypeParameters(compiler)) { |
| 41 !link.isEmpty; | 41 addMemberByName(parameter.element); |
| 42 link = link.tail) { | |
| 43 addMemberByName(link.head.element); | |
| 44 } | 42 } |
| 45 } | 43 } |
| 46 allElementsByName[name] = allElementsByName.putIfAbsent( | 44 allElementsByName[name] = allElementsByName.putIfAbsent( |
| 47 name, () => const Link<Element>()).prepend(element); | 45 name, () => const Link<Element>()).prepend(element); |
| 48 if (container != null) { | 46 if (container != null) { |
| 49 container.forEachLocalMember(addMemberByName); | 47 container.forEachLocalMember(addMemberByName); |
| 50 } | 48 } |
| 51 } | 49 } |
| 52 | 50 |
| 53 compiler.libraries.values.forEach(addMemberByName); | 51 compiler.libraries.values.forEach(addMemberByName); |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 } | 760 } |
| 763 CodegenWorkItem workItem = new CodegenWorkItem( | 761 CodegenWorkItem workItem = new CodegenWorkItem( |
| 764 element, itemCompilationContextCreator()); | 762 element, itemCompilationContextCreator()); |
| 765 queue.add(workItem); | 763 queue.add(workItem); |
| 766 } | 764 } |
| 767 | 765 |
| 768 void _logSpecificSummary(log(message)) { | 766 void _logSpecificSummary(log(message)) { |
| 769 log('Compiled ${generatedCode.length} methods.'); | 767 log('Compiled ${generatedCode.length} methods.'); |
| 770 } | 768 } |
| 771 } | 769 } |
| OLD | NEW |