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

Unified Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2988373002: Store parts in Kernel Library, resynthesize parts in Analyzer. (Closed)
Patch Set: Fixes for review comments. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | pkg/kernel/lib/visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/binary/ast_to_binary.dart
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index 7c63b495c1b1f54033558d2ade3f5be33a4d0d93..291908feef1b569d99e59f10211307f9d031d6a4 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -312,6 +312,7 @@ class BinaryPrinter extends Visitor {
writeUriReference(node.fileUri ?? '');
writeAnnotationList(node.annotations);
writeLibraryDependencies(node);
+ writeLibraryParts(node);
writeNodeList(node.typedefs);
writeNodeList(node.classes);
writeNodeList(node.fields);
@@ -343,6 +344,19 @@ class BinaryPrinter extends Visitor {
writeStringReferenceList(node.names);
}
+ void writeLibraryParts(Library library) {
+ writeUInt30(library.parts.length);
+ for (int i = 0; i < library.parts.length; ++i) {
+ var partNode = library.parts[i];
+ writeLibraryPart(partNode);
+ }
+ }
+
+ void writeLibraryPart(LibraryPart node) {
+ writeNodeList(node.annotations);
+ writeStringReference(node.fileUri ?? '');
+ }
+
void visitTypedef(Typedef node) {
writeCanonicalNameReference(getCanonicalNameOfTypedef(node));
writeOffset(node.fileOffset);
@@ -1364,6 +1378,12 @@ class StringIndexer extends RecursiveVisitor<Null> {
node.visitChildren(this);
}
+ @override
+ visitLibraryPart(LibraryPart node) {
+ put(node.fileUri);
+ node.visitChildren(this);
+ }
+
visitCombinator(Combinator node) {
node.names.forEach(put);
}
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | pkg/kernel/lib/visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698