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

Unified Diff: pkg/kernel/lib/text/ast_to_text.dart

Issue 2659343002: Add IR nodes needed for deferred loading. (Closed)
Patch Set: Update binary.md Created 3 years, 11 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/tag.dart ('k') | pkg/kernel/lib/type_checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/text/ast_to_text.dart
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
index a0e722740c670be7aacd0a04f5999c75583fdc53..d8c892e3e0f50fb52dede9756196a4703a0205e9 100644
--- a/pkg/kernel/lib/text/ast_to_text.dart
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -302,6 +302,9 @@ class Printer extends Visitor<Null> {
endLine('import "$importPath" as $prefix;');
}
}
+ for (var import in library.deferredImports) {
+ import.accept(this);
+ }
endLine();
var inner = new Printer._inner(this, imports);
library.classes.forEach(inner.writeNode);
@@ -985,6 +988,30 @@ class Printer extends Visitor<Null> {
writeExpression(node.body);
}
+ visitLoadLibrary(LoadLibrary node) {
+ writeWord('LoadLibrary');
+ writeSymbol('(');
+ writeWord(node.import.name);
+ writeSymbol(')');
+ state = WORD;
+ }
+
+ visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node) {
+ writeWord('CheckLibraryIsLoaded');
+ writeSymbol('(');
+ writeWord(node.import.name);
+ writeSymbol(')');
+ state = WORD;
+ }
+
+ visitDeferredImport(DeferredImport node) {
+ write('import "');
+ write('${node.importedLibrary.importUri}');
+ write('" deferred as ');
+ write(node.name);
+ endLine(';');
+ }
+
defaultExpression(Expression node) {
writeWord('${node.runtimeType}');
}
« no previous file with comments | « pkg/kernel/lib/binary/tag.dart ('k') | pkg/kernel/lib/type_checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698