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

Unified Diff: pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart

Issue 1892093003: Support deserialized compilation of the empty program. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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
Index: pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
index fe2bdacad904bdfd95a50ca25f7e4c6b158ba878..b9acc8ca6d67c435a0eff5f378a6927722f42575 100644
--- a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
@@ -108,6 +108,9 @@ class ResolvedAstSerializer extends Visitor {
Key.URI,
elements.analyzedElement.compilationUnit.script.resourceUri,
elements.analyzedElement.compilationUnit.script.resourceUri);
+ if (resolvedAst.body != null) {
+ objectEncoder.setInt(Key.BODY, nodeIndices[resolvedAst.body]);
+ }
AstKind kind;
if (element.enclosingClass is EnumClassElement) {
if (element.name == 'index') {
@@ -479,6 +482,11 @@ class ResolvedAstDeserializer {
AstIndexComputer indexComputer = new AstIndexComputer();
Map<Node, int> nodeIndices = indexComputer.nodeIndices;
List<Node> nodeList = indexComputer.nodeList;
+ Node body;
+ int bodyNodeIndex = objectDecoder.getInt(Key.BODY, isOptional: true);
+ if (bodyNodeIndex != null) {
+ body = nodeList[bodyNodeIndex];
+ }
root.accept(indexComputer);
List<JumpTarget> jumpTargets = <JumpTarget>[];
@@ -594,6 +602,6 @@ class ResolvedAstDeserializer {
}
}
}
- return new ParsedResolvedAst(element, root, elements);
+ return new ParsedResolvedAst(element, root, body, elements);
}
}

Powered by Google App Engine
This is Rietveld 408576698