mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[fasta] Incremental compilation and parts
The incremental compiler calculates which libraries are reusable, but previously forgot about parts when mapping for changed files to libraries. This CL fixes that, meaning that a changed part file will invalidate the Library it's a part of, meaning we get the needed re-compilation. Fixes #31908. Change-Id: Ic30c97af3f1c8166a82774040a2bbcebf5686415 Reviewed-on: https://dart-review.googlesource.com/34821 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Peter von der Ahé <ahe@google.com>
This commit is contained in:
parent
897114ff79
commit
bfda4508a9
|
@ -106,24 +106,30 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
|
|||
Set<Uri> invalidatedFileUris = invalidatedUris.toSet();
|
||||
|
||||
// Maps all non-platform LibraryBuilders from their import URI.
|
||||
Map<Uri, LibraryBuilder> builders = <Uri, LibraryBuilder>{};
|
||||
Map<Uri, SourceLibraryBuilder> builders = <Uri, SourceLibraryBuilder>{};
|
||||
|
||||
// Invalidated URIs translated back to their import URI (package:, dart:,
|
||||
// etc.).
|
||||
List<Uri> invalidatedImportUris = <Uri>[];
|
||||
|
||||
// Compute [builders] and [invalidatedImportUris].
|
||||
userCode.loader.builders.forEach((Uri uri, LibraryBuilder library) {
|
||||
if (library.loader != platform.loader) {
|
||||
assert(library is SourceLibraryBuilder);
|
||||
addBuilderAndInvalidateUris(Uri uri, LibraryBuilder libraryBuilder) {
|
||||
if (libraryBuilder.loader != platform.loader) {
|
||||
assert(libraryBuilder is SourceLibraryBuilder);
|
||||
SourceLibraryBuilder library = libraryBuilder;
|
||||
builders[uri] = library;
|
||||
if (invalidatedFileUris.contains(uri) ||
|
||||
(uri != library.fileUri &&
|
||||
invalidatedFileUris.contains(library.fileUri))) {
|
||||
invalidatedImportUris.add(uri);
|
||||
}
|
||||
for (var part in library.parts) {
|
||||
addBuilderAndInvalidateUris(part.uri, part);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
userCode.loader.builders.forEach(addBuilderAndInvalidateUris);
|
||||
|
||||
SourceGraph graph = new SourceGraph(builders);
|
||||
|
||||
|
@ -153,7 +159,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
return builders.values.toList();
|
||||
return builders.values.where((builder) => !builder.isPart).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
# Status file for the test suite ../test/fasta/incremental_test.dart.
|
||||
|
||||
dartino/change_in_part.incremental: Fail # Issue 31908 (parts aren't handled correctly)
|
||||
dartino/override_field_with_method_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
|
||||
dartino/override_getter_with_method_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
|
||||
dartino/override_method_with_field_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
|
||||
|
|
Loading…
Reference in a new issue