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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 2256203002: Ensure metadata on imports/exports is resolved for serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.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 library dart2js.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'cache_strategy.dart' show CacheStrategy; 10 import 'cache_strategy.dart' show CacheStrategy;
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 library.implementation.forEachLocalMember(enqueueAll); 897 library.implementation.forEachLocalMember(enqueueAll);
898 library.imports.forEach((ImportElement import) { 898 library.imports.forEach((ImportElement import) {
899 if (import.isDeferred) { 899 if (import.isDeferred) {
900 // `import.prefix` and `loadLibrary` may be `null` when the deferred 900 // `import.prefix` and `loadLibrary` may be `null` when the deferred
901 // import has compile-time errors. 901 // import has compile-time errors.
902 GetterElement loadLibrary = import.prefix?.loadLibrary; 902 GetterElement loadLibrary = import.prefix?.loadLibrary;
903 if (loadLibrary != null) { 903 if (loadLibrary != null) {
904 world.addToWorkList(loadLibrary); 904 world.addToWorkList(loadLibrary);
905 } 905 }
906 } 906 }
907 for (MetadataAnnotation metadata in import.metadata) {
Siggi Cherem (dart-lang) 2016/08/18 15:28:17 how about only doing this if serialization is turn
Johnni Winther 2016/08/19 08:16:53 Done.
908 metadata.ensureResolved(resolution);
909 }
910 });
911 library.exports.forEach((ExportElement export) {
912 for (MetadataAnnotation metadata in export.metadata) {
913 metadata.ensureResolved(resolution);
914 }
907 }); 915 });
908 } 916 }
909 917
910 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) { 918 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) {
911 if (element.isClass) { 919 if (element.isClass) {
912 ClassElement cls = element; 920 ClassElement cls = element;
913 cls.ensureResolved(resolution); 921 cls.ensureResolved(resolution);
914 cls.forEachLocalMember(enqueuer.resolution.addToWorkList); 922 cls.forEachLocalMember(enqueuer.resolution.addToWorkList);
915 backend.registerInstantiatedType(cls.rawType, world, globalDependencies); 923 backend.registerInstantiatedType(cls.rawType, world, globalDependencies);
916 } else { 924 } else {
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2176 _ElementScanner(this.scanner); 2184 _ElementScanner(this.scanner);
2177 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2185 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2178 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2186 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2179 } 2187 }
2180 2188
2181 class _EmptyEnvironment implements Environment { 2189 class _EmptyEnvironment implements Environment {
2182 const _EmptyEnvironment(); 2190 const _EmptyEnvironment();
2183 2191
2184 String valueOf(String key) => null; 2192 String valueOf(String key) => null;
2185 } 2193 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698