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

Unified Diff: dart/pkg/dart2js_incremental/lib/caching_compiler.dart

Issue 564373004: Add LibraryLoader.resetAsync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Restore code. Created 6 years, 3 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 | dart/pkg/dart2js_incremental/lib/dart2js_incremental.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/dart2js_incremental/lib/caching_compiler.dart
diff --git a/dart/pkg/dart2js_incremental/lib/caching_compiler.dart b/dart/pkg/dart2js_incremental/lib/caching_compiler.dart
index afdf92f8ffd7beda7b2ee167f9366fd4c82349a5..9adf0b96e1d37b8e4fbc62d6f32c950ece293cd4 100644
--- a/dart/pkg/dart2js_incremental/lib/caching_compiler.dart
+++ b/dart/pkg/dart2js_incremental/lib/caching_compiler.dart
@@ -6,7 +6,7 @@ part of dart2js_incremental;
/// Do not call this method directly. It will be made private.
// TODO(ahe): Make this method private.
-Compiler reuseCompiler(
+Future<Compiler> reuseCompiler(
{DiagnosticHandler diagnosticHandler,
CompilerInputProvider inputProvider,
CompilerOutputProvider outputProvider,
@@ -16,7 +16,7 @@ Compiler reuseCompiler(
Uri packageRoot,
bool packagesAreImmutable: false,
Map<String, dynamic> environment,
- bool reuseLibrary(LibraryElement library)}) {
+ Future<bool> reuseLibrary(LibraryElement library)}) {
UserTag oldTag = new UserTag('_reuseCompiler').makeCurrent();
if (libraryRoot == null) {
throw 'Missing libraryRoot';
@@ -55,14 +55,16 @@ Compiler reuseCompiler(
print('Unable to reuse compiler.');
}
}
- compiler = new Compiler(
- inputProvider,
- outputProvider,
- diagnosticHandler,
- libraryRoot,
- packageRoot,
- options,
- environment);
+ oldTag.makeCurrent();
+ return new Future.value(
+ new Compiler(
+ inputProvider,
+ outputProvider,
+ diagnosticHandler,
+ libraryRoot,
+ packageRoot,
+ options,
+ environment));
} else {
for (final task in compiler.tasks) {
if (task.watch != null) {
@@ -138,13 +140,14 @@ Compiler reuseCompiler(
if (reuseLibrary == null) {
reuseLibrary = (LibraryElement library) {
- return
+ return new Future.value(
library.isPlatformLibrary ||
- (packagesAreImmutable && library.isPackageLibrary);
+ (packagesAreImmutable && library.isPackageLibrary));
};
}
- compiler.libraryLoader.reset(reuseLibrary: reuseLibrary);
+ return compiler.libraryLoader.resetAsync(reuseLibrary).then((_) {
+ oldTag.makeCurrent();
+ return compiler;
+ });
}
- oldTag.makeCurrent();
- return compiler;
}
« no previous file with comments | « no previous file | dart/pkg/dart2js_incremental/lib/dart2js_incremental.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698