Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 286983004: Include internal library members when enqueuing everything. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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;
11 final CodegenEnqueuer codegen; 11 final CodegenEnqueuer codegen;
12 12
13 /// A reverse map from name to *all* elements with that name, not 13 /// A reverse map from name to *all* elements with that name, not
14 /// just instance members of instantiated classes. 14 /// just instance members of instantiated classes.
15 final Map<String, Link<Element>> allElementsByName 15 final Map<String, Link<Element>> allElementsByName
16 = new Map<String, Link<Element>>(); 16 = new Map<String, Link<Element>>();
17 17
18 void ensureAllElementsByName() { 18 void ensureAllElementsByName() {
19 if (!allElementsByName.isEmpty) return; 19 if (!allElementsByName.isEmpty) return;
20 20
21 void addMemberByName(Element element) { 21 void addMemberByName(Element element) {
22 element = element.declaration; 22 element = element.declaration;
23 String name = element.name; 23 String name = element.name;
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 // Don't include private implementation libraries. These 27 container = library;
28 // libraries contain special classes that cause problems 28 // TODO(ahe): Is this right? Is this necessary?
29 // in other parts of the resolver (in particular Null and Void). 29 name = library.getLibraryOrScriptName();
30 // TODO(ahe): Consider lifting this restriction.
31 if (!library.isInternalLibrary) {
32 container = library;
33 // TODO(ahe): Is this right? Is this necessary?
34 name = library.getLibraryOrScriptName();
35 }
36 } else if (element.isClass) { 30 } else if (element.isClass) {
37 ClassElement cls = element; 31 ClassElement cls = element;
38 cls.ensureResolved(compiler); 32 cls.ensureResolved(compiler);
39 container = cls; 33 container = cls;
40 for (var link = cls.computeTypeParameters(compiler); 34 for (var link = cls.computeTypeParameters(compiler);
41 !link.isEmpty; 35 !link.isEmpty;
42 link = link.tail) { 36 link = link.tail) {
43 addMemberByName(link.head.element); 37 addMemberByName(link.head.element);
44 } 38 }
45 } 39 }
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 766 }
773 CodegenWorkItem workItem = new CodegenWorkItem( 767 CodegenWorkItem workItem = new CodegenWorkItem(
774 element, itemCompilationContextCreator()); 768 element, itemCompilationContextCreator());
775 queue.add(workItem); 769 queue.add(workItem);
776 } 770 }
777 771
778 void _logSpecificSummary(log(message)) { 772 void _logSpecificSummary(log(message)) {
779 log('Compiled ${generatedCode.length} methods.'); 773 log('Compiled ${generatedCode.length} methods.');
780 } 774 }
781 } 775 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698