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

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

Issue 30003002: Revert "Resolve metadata on library tags" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | tests/lib/mirrors/library_metatarget_test.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 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 1053
1054 log('Resolving...'); 1054 log('Resolving...');
1055 phase = PHASE_RESOLVING; 1055 phase = PHASE_RESOLVING;
1056 if (analyzeAll) { 1056 if (analyzeAll) {
1057 libraries.forEach( 1057 libraries.forEach(
1058 (_, lib) => fullyEnqueueLibrary(lib, enqueuer.resolution)); 1058 (_, lib) => fullyEnqueueLibrary(lib, enqueuer.resolution));
1059 } 1059 }
1060 // Elements required by enqueueHelpers are global dependencies 1060 // Elements required by enqueueHelpers are global dependencies
1061 // that are not pulled in by a particular element. 1061 // that are not pulled in by a particular element.
1062 backend.enqueueHelpers(enqueuer.resolution, globalDependencies); 1062 backend.enqueueHelpers(enqueuer.resolution, globalDependencies);
1063 resolveLibraryMetadata();
1064 processQueue(enqueuer.resolution, main); 1063 processQueue(enqueuer.resolution, main);
1065 enqueuer.resolution.logSummary(log); 1064 enqueuer.resolution.logSummary(log);
1066 1065
1067 if (compilationFailed) return; 1066 if (compilationFailed) return;
1068 if (analyzeOnly) return; 1067 if (analyzeOnly) return;
1069 assert(main != null); 1068 assert(main != null);
1070 phase = PHASE_DONE_RESOLVING; 1069 phase = PHASE_DONE_RESOLVING;
1071 1070
1072 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution 1071 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution
1073 // should know this. 1072 // should know this.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 if (element.isClass()) { 1120 if (element.isClass()) {
1122 ClassElement cls = element; 1121 ClassElement cls = element;
1123 cls.ensureResolved(this); 1122 cls.ensureResolved(this);
1124 cls.forEachLocalMember(enqueuer.resolution.addToWorkList); 1123 cls.forEachLocalMember(enqueuer.resolution.addToWorkList);
1125 world.registerInstantiatedClass(element, globalDependencies); 1124 world.registerInstantiatedClass(element, globalDependencies);
1126 } else { 1125 } else {
1127 world.addToWorkList(element); 1126 world.addToWorkList(element);
1128 } 1127 }
1129 } 1128 }
1130 1129
1131 // Resolves metadata on library elements. This is necessary in order to
1132 // resolve metadata classes referenced only from metadata on library tags.
1133 // TODO(ahe): Figure out how to do this lazily.
1134 void resolveLibraryMetadata() {
1135 for (LibraryElement library in libraries.values) {
1136 for (MetadataAnnotation metadata in library.metadata) {
1137 metadata.ensureResolved(this);
1138 }
1139 }
1140 }
1141
1142 void processQueue(Enqueuer world, Element main) { 1130 void processQueue(Enqueuer world, Element main) {
1143 world.nativeEnqueuer.processNativeClasses(libraries.values); 1131 world.nativeEnqueuer.processNativeClasses(libraries.values);
1144 if (main != null) { 1132 if (main != null) {
1145 world.addToWorkList(main); 1133 world.addToWorkList(main);
1146 } 1134 }
1147 progress.reset(); 1135 progress.reset();
1148 world.forEach((WorkItem work) { 1136 world.forEach((WorkItem work) {
1149 withCurrentElement(work.element, () => work.run(this, world)); 1137 withCurrentElement(work.element, () => work.run(this, world));
1150 }); 1138 });
1151 world.queueIsClosed = true; 1139 world.queueIsClosed = true;
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 1602
1615 void close() {} 1603 void close() {}
1616 1604
1617 toString() => name; 1605 toString() => name;
1618 1606
1619 /// Convenience method for getting an [api.CompilerOutputProvider]. 1607 /// Convenience method for getting an [api.CompilerOutputProvider].
1620 static NullSink outputProvider(String name, String extension) { 1608 static NullSink outputProvider(String name, String extension) {
1621 return new NullSink('$name.$extension'); 1609 return new NullSink('$name.$extension');
1622 } 1610 }
1623 } 1611 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/library_metatarget_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698