Chromium Code Reviews| 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 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |