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

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

Issue 622373002: Compile only functions that have changed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r40934. Created 6 years, 2 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 | no next file » | 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 6993d1e0c6cd1565f307897caff52daaf3b77f28..f0f61a1f789a63a6dc06f8b9423b25acccccfe9f 100644
--- a/dart/site/try/poi/poi.dart
+++ b/dart/site/try/poi/poi.dart
@@ -60,6 +60,9 @@ import 'package:compiler/implementation/scanner/scannerlib.dart' show
PartialElement,
Token;
+import 'package:compiler/implementation/js/js.dart' show
+ prettyPrint;
+
/// Enabled by the option --enable-dart-mind. Controls if this program should
/// be querying Dart Mind.
bool isDartMindEnabled = false;
@@ -424,7 +427,34 @@ Future<Element> runPoiInternal(
}
sw.reset();
- Future<bool> compilation = cachedCompiler.run(updater.uri);
+ Future<bool> compilation;
+
+ if (updater.hasPendingUpdates) {
+ List<Element> updatedElements = updater.applyUpdates();
+ compilation = new Future(() {
+ cachedCompiler.progress.reset();
+ for (Element element in updatedElements) {
+ cachedCompiler.enqueuer.resolution.addToWorkList(element);
+ }
+ cachedCompiler.processQueue(cachedCompiler.enqueuer.resolution, null);
+
+ cachedCompiler.phase = Compiler.PHASE_DONE_RESOLVING;
+
+ for (Element element in updatedElements) {
+ cachedCompiler.enqueuer.codegen.addToWorkList(element);
+ }
+ cachedCompiler.processQueue(cachedCompiler.enqueuer.codegen, null);
+
+ for (Element element in updatedElements) {
+ var node = cachedCompiler.enqueuer.codegen.generatedCode[element];
+ print(prettyPrint(node, cachedCompiler).getText());
+ }
+
+ return !cachedCompiler.compilationFailed;
+ });
+ } else {
+ compilation = cachedCompiler.run(updater.uri);
+ }
return compilation.then((success) {
printVerbose('Compiler queue processed in ${sw.elapsedMicroseconds}us');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698