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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2885743002: Include only changed or affected libraries into delta. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index ad86ecad33a76270ed55117786b3ca8a4e3f4f45..b9aada00881724d4e7810e464f3fa3daf492512d 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -63,6 +63,9 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
/// The URI of the program entry point.
final Uri _entryPoint;
+ /// Latest compilation signatures produced by [computeDelta] for libraries.
+ final Map<Uri, String> _uriToLatestSignature = {};
Siggi Cherem (dart-lang) 2017/05/17 18:15:10 optional style nit: consider dropping "_uriTo" fro
scheglov 2017/05/17 22:04:05 OK Will do in https://codereview.chromium.org/2893
+
/// The set of absolute file URIs that were reported through [invalidate]
/// and not checked for actual changes yet.
final Set<Uri> _invalidatedFiles = new Set<Uri>();
@@ -102,10 +105,20 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
});
Program program = new Program(nameRoot: nameRoot);
+
+ // Add affected libraries (with different signatures).
for (_LibraryCycleResult result in results) {
- program.libraries.addAll(result.kernelLibraries);
+ for (Library library in result.kernelLibraries) {
+ Uri uri = library.importUri;
+ if (_uriToLatestSignature[uri] != result.signature) {
+ _uriToLatestSignature[uri] = result.signature;
+ program.libraries.add(library);
+ }
+ }
}
+ // TODO(scheglov) Add libraries which import changed libraries.
+
return new DeltaProgram(program);
});
}
« no previous file with comments | « pkg/front_end/lib/incremental_kernel_generator.dart ('k') | pkg/front_end/test/incremental_kernel_generator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698