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

Unified Diff: dart/site/try/poi/poi.dart

Issue 594843003: Introduce LibraryUpdater. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Johnni's comments. 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 | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | dart/tests/try/poi/compiler_test_case.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/poi/poi.dart
diff --git a/dart/site/try/poi/poi.dart b/dart/site/try/poi/poi.dart
index f8170880df61b573d3bfd9c550ed28dc74daa56e..bf77cb830b6c9520f434a8228173653791fe6c37 100644
--- a/dart/site/try/poi/poi.dart
+++ b/dart/site/try/poi/poi.dart
@@ -24,6 +24,9 @@ import 'dart:convert' show
import 'package:dart2js_incremental/dart2js_incremental.dart' show
reuseCompiler;
+import 'package:dart2js_incremental/library_updater.dart' show
+ LibraryUpdater;
+
import 'package:compiler/implementation/source_file_provider.dart' show
FormattingDiagnosticHandler;
@@ -372,6 +375,10 @@ Future<Element> runPoi(
'--disable-type-inference',
];
+ LibraryUpdater updater =
+ new LibraryUpdater(
+ cachedCompiler, inputProvider, script, printWallClock, printVerbose);
+
return reuseCompiler(
diagnosticHandler: handler,
inputProvider: inputProvider,
@@ -379,20 +386,33 @@ Future<Element> runPoi(
cachedCompiler: cachedCompiler,
libraryRoot: libraryRoot,
packageRoot: packageRoot,
- packagesAreImmutable: true).then((Compiler newCompiler) {
+ packagesAreImmutable: true,
+ reuseLibrary: updater.reuseLibrary).then((Compiler newCompiler) {
var filter = new ScriptOnlyFilter(script);
newCompiler.enqueuerFilter = filter;
- return runPoiInternal(newCompiler, script, position);
+ return runPoiInternal(newCompiler, updater, position);
});
}
Future<Element> runPoiInternal(
Compiler newCompiler,
- Uri uri,
+ LibraryUpdater updater,
int position) {
cachedCompiler = newCompiler;
- return cachedCompiler.run(uri).then((success) {
+ Future<bool> compilation = cachedCompiler.run(updater.uri);
+
+ return compilation.then((success) {
+ if (isVerbose) {
+ for (final task in cachedCompiler.tasks) {
+ int time = task.timingMicroseconds;
+ if (time != 0) {
+ printFormattedTime('${task.name} took', time);
+ }
+ }
+ }
+
+ if (poiCount != null) poiCount++;
if (success != true) {
throw 'Compilation failed';
}
« no previous file with comments | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | dart/tests/try/poi/compiler_test_case.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698