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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 2091693005: Serialize only unserialized libraries on --resolve-only (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index ced831b979ee5db2b06257f609a25ff0828a1fd5..5707bdc2cd28e89534f9b61aaaff498a9cbccaaa 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -810,7 +810,14 @@ abstract class Compiler implements LibraryLoaderListener {
supportSerialization: serialization.supportSerialization);
phase = PHASE_RESOLVING;
- if (analyzeAll) {
+ if (options.resolveOnly) {
+ libraryLoader.libraries.where((LibraryElement library) {
+ return !serialization.isDeserialized(library);
+ }).forEach((LibraryElement library) {
+ reporter.log('Enqueuing ${library.canonicalUri}');
+ fullyEnqueueLibrary(library, enqueuer.resolution);
+ });
+ } else if (analyzeAll) {
libraryLoader.libraries.forEach((LibraryElement library) {
reporter.log('Enqueuing ${library.canonicalUri}');
fullyEnqueueLibrary(library, enqueuer.resolution);
@@ -846,9 +853,11 @@ abstract class Compiler implements LibraryLoaderListener {
if (options.resolveOnly) {
reporter.log('Serializing to ${options.resolutionOutput}');
- serialization.serializeToSink(
- userOutputProvider.createEventSink('', 'data'),
- libraryLoader.libraries);
+ serialization
+ .serializeToSink(userOutputProvider.createEventSink('', 'data'),
+ libraryLoader.libraries.where((LibraryElement library) {
+ return !serialization.isDeserialized(library);
+ }));
}
if (options.analyzeOnly) {
if (!analyzeAll && !compilationFailed) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698