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

Unified Diff: sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 180843012: Make deferred loading and meta-data play better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/deferred_load.dart
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index fc1b601ba1d95725cfb581b2d55c95ba3a132527..7fdb7966ec1664601098592166786b1d23c9bd8a 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -271,7 +271,10 @@ class DeferredLoadTask extends CompilerTask {
Set<Constant> constants) {
element = element.implementation;
for (MetadataAnnotation metadata in element.metadata) {
- if (metadata.value != null) constants.add(metadata.value);
+ if (metadata.value != null) {
+ constants.add(metadata.value);
+ elements.add(metadata.value.computeType(compiler).element);
+ }
}
if (element.isClass()) {
// If we see a class, add everything its instance members refer
@@ -379,6 +382,23 @@ class DeferredLoadTask extends CompilerTask {
LibraryElement deferredLibrary = _allDeferredImports[deferredImport];
for (LibraryElement library in
_nonDeferredReachableLibraries(deferredLibrary)) {
+ // TODO(sigurdm): The metadata should go to the right output unit.
+ // For now they all go to the main output unit.
+ for (MetadataAnnotation metadata in library.metadata) {
+ if (metadata.value != null) {
+ _mapDependencies(metadata.value.computeType(compiler).element,
+ _fakeMainImport);
+ }
+ }
+ for (LibraryTag tag in library.tags) {
+ for (MetadataAnnotation metadata in tag.metadata) {
+ if (metadata.value != null) {
+ _mapDependencies(metadata.value.computeType(compiler).element,
+ _fakeMainImport);
+ }
+ }
+ }
+
if (mirrorTask.librariesWithUsage.contains(library)) {
Map<LibraryElement, List<MirrorUsage>> mirrorsResult =
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698