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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1523093003: Move summary references into UnlinkedUnit and PrelinkedUnit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 642369d8859526caeebb213062e275c4feec1815..8f8277cffe11d9cc1f654662b5286546ff335733 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -80,17 +80,15 @@ class _LibrarySerializer {
/**
* The unlinked portion of the "references table". This is the list of
- * objects which should be written to [UnlinkedLibrary.references].
+ * objects which should be written to [UnlinkedUnit.references].
*/
- final List<UnlinkedReferenceBuilder> unlinkedReferences =
- <UnlinkedReferenceBuilder>[];
+ List<UnlinkedReferenceBuilder> unlinkedReferences;
/**
* The prelinked portion of the "references table". This is the list of
- * objects which should be written to [PrelinkedLibrary.references].
+ * objects which should be written to [PrelinkedUnit.references].
*/
- final List<PrelinkedReferenceBuilder> prelinkedReferences =
- <PrelinkedReferenceBuilder>[];
+ List<PrelinkedReferenceBuilder> prelinkedReferences;
//final Map<String, int> prefixIndices = <String, int>{};
@@ -156,6 +154,8 @@ class _LibrarySerializer {
(CompilationUnitElement e) => encodeUnlinkedPart(ctx, uri: e.uri))
.toList();
}
+ unlinkedReferences = <UnlinkedReferenceBuilder>[];
+ prelinkedReferences = <PrelinkedReferenceBuilder>[];
b.classes = element.types.map(serializeClass).toList();
b.enums = element.enums.map(serializeEnum).toList();
b.typedefs = element.functionTypeAliases.map(serializeTypedef).toList();
@@ -178,7 +178,11 @@ class _LibrarySerializer {
}
}
b.variables = variables;
- units.add(encodePrelinkedUnit(ctx, unlinked: b));
+ b.references = unlinkedReferences;
+ units.add(
+ encodePrelinkedUnit(ctx, unlinked: b, references: prelinkedReferences));
+ unlinkedReferences = null;
+ prelinkedReferences = null;
}
/**
@@ -420,12 +424,10 @@ class _LibrarySerializer {
addCompilationUnitElements(libraryElement.parts[i], i + 1);
}
ub.prefixes = prefixes;
- ub.references = unlinkedReferences;
pb.units = units;
pb.unlinked = ub;
pb.dependencies = dependencies;
pb.importDependencies = prelinkedImports;
- pb.references = prelinkedReferences;
return pb;
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698