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

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: Updated cf. comments. 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 | pkg/compiler/lib/src/resolution/constructors.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 if (serialization.supportSerialization) {
908 for (MetadataAnnotation metadata in import.metadata) {
909 metadata.ensureResolved(resolution);
910 }
911 }
907 }); 912 });
913 if (serialization.supportSerialization) {
914 library.exports.forEach((ExportElement export) {
915 for (MetadataAnnotation metadata in export.metadata) {
916 metadata.ensureResolved(resolution);
917 }
918 });
919 }
908 } 920 }
909 921
910 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) { 922 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) {
911 if (element.isClass) { 923 if (element.isClass) {
912 ClassElement cls = element; 924 ClassElement cls = element;
913 cls.ensureResolved(resolution); 925 cls.ensureResolved(resolution);
914 cls.forEachLocalMember(enqueuer.resolution.addToWorkList); 926 cls.forEachLocalMember(enqueuer.resolution.addToWorkList);
915 backend.registerInstantiatedType(cls.rawType, world, globalDependencies); 927 backend.registerInstantiatedType(cls.rawType, world, globalDependencies);
916 } else { 928 } else {
917 world.addToWorkList(element); 929 world.addToWorkList(element);
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2176 _ElementScanner(this.scanner); 2188 _ElementScanner(this.scanner);
2177 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2189 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2178 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2190 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2179 } 2191 }
2180 2192
2181 class _EmptyEnvironment implements Environment { 2193 class _EmptyEnvironment implements Environment {
2182 const _EmptyEnvironment(); 2194 const _EmptyEnvironment();
2183 2195
2184 String valueOf(String key) => null; 2196 String valueOf(String key) => null;
2185 } 2197 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698