| 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 13 matching lines...) Expand all Loading... |
| 24 ScopeContainerElement container = null; | 24 ScopeContainerElement container = null; |
| 25 if (element.isLibrary) { | 25 if (element.isLibrary) { |
| 26 LibraryElement library = element; | 26 LibraryElement library = element; |
| 27 container = library; | 27 container = library; |
| 28 // TODO(ahe): Is this right? Is this necessary? | 28 // TODO(ahe): Is this right? Is this necessary? |
| 29 name = library.getLibraryOrScriptName(); | 29 name = library.getLibraryOrScriptName(); |
| 30 } else if (element.isClass) { | 30 } else if (element.isClass) { |
| 31 ClassElement cls = element; | 31 ClassElement cls = element; |
| 32 cls.ensureResolved(compiler); | 32 cls.ensureResolved(compiler); |
| 33 container = cls; | 33 container = cls; |
| 34 for (var link = cls.computeTypeParameters(compiler); | 34 for (DartType parameter in cls.computeTypeParameters(compiler)) { |
| 35 !link.isEmpty; | 35 addMemberByName(parameter.element); |
| 36 link = link.tail) { | |
| 37 addMemberByName(link.head.element); | |
| 38 } | 36 } |
| 39 } | 37 } |
| 40 allElementsByName[name] = allElementsByName.putIfAbsent( | 38 allElementsByName[name] = allElementsByName.putIfAbsent( |
| 41 name, () => const Link<Element>()).prepend(element); | 39 name, () => const Link<Element>()).prepend(element); |
| 42 if (container != null) { | 40 if (container != null) { |
| 43 container.forEachLocalMember(addMemberByName); | 41 container.forEachLocalMember(addMemberByName); |
| 44 } | 42 } |
| 45 } | 43 } |
| 46 | 44 |
| 47 compiler.libraryLoader.libraries.forEach(addMemberByName); | 45 compiler.libraryLoader.libraries.forEach(addMemberByName); |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 728 } |
| 731 CodegenWorkItem workItem = new CodegenWorkItem( | 729 CodegenWorkItem workItem = new CodegenWorkItem( |
| 732 element, itemCompilationContextCreator()); | 730 element, itemCompilationContextCreator()); |
| 733 queue.add(workItem); | 731 queue.add(workItem); |
| 734 } | 732 } |
| 735 | 733 |
| 736 void _logSpecificSummary(log(message)) { | 734 void _logSpecificSummary(log(message)) { |
| 737 log('Compiled ${generatedCode.length} methods.'); | 735 log('Compiled ${generatedCode.length} methods.'); |
| 738 } | 736 } |
| 739 } | 737 } |
| OLD | NEW |