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

Unified Diff: pkg/front_end/lib/summary_generator.dart

Issue 2953703002: Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service (Closed)
Patch Set: Created 3 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
Index: pkg/front_end/lib/summary_generator.dart
diff --git a/pkg/front_end/lib/summary_generator.dart b/pkg/front_end/lib/summary_generator.dart
index 0c494c42a7ad252f356b34dfee9589243990d877..79a55baf8ff1e782fd898b61b625a5020be6d86c 100644
--- a/pkg/front_end/lib/summary_generator.dart
+++ b/pkg/front_end/lib/summary_generator.dart
@@ -8,6 +8,8 @@ library front_end.summary_generator;
import 'dart:async';
import 'compiler_options.dart';
+import 'src/kernel_generator_impl.dart';
+
/// Creates a summary representation of the build unit whose source files are in
/// [sources].
///
@@ -16,17 +18,25 @@ import 'compiler_options.dart';
/// [sources] should be the complete set of source files for a build unit
/// (including both library and part files).
///
-/// The summarization process is hermetic, meaning that the only files which
-/// will be read are those listed in [sources],
+/// By default, the compilation process is hermetic, meaning that the only files
+/// which will be read are those listed in [sources],
/// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary]. If a
/// source file attempts to refer to a file which is not obtainable from these
-/// paths, that will result in an error, even if the file exists on the
+/// URIs, that will result in an error, even if the file exists on the
/// filesystem.
///
+/// When [CompilerOptions.chaseDependencies] is true, this default behavior
+/// changes, and any dependency of [sources] that is not listed in
+/// [CompilerOptions.inputSummaries] and [CompilerOptions.sdkSummary] is treated
+/// as an additional source file for the build unit.
+///
/// Any `part` declarations found in [sources] must refer to part files which
-/// are also listed in [sources], otherwise an error results. (It is not
-/// permitted to refer to a part file declared in another build unit).
+/// are also listed in the build unit sources, otherwise an error results. (It
+/// is not permitted to refer to a part file declared in another build unit).
///
/// The return value is a list of bytes to write to the summary file.
ahe 2017/07/03 10:05:31 If we're concerned about memory usage, this API sh
Siggi Cherem (dart-lang) 2017/07/05 03:39:30 True - we also have some open discussion about whe
-Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) =>
- throw new UnimplementedError();
+Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) async {
+ return (await generateKernel(sources, options,
+ buildSummary: true, buildProgram: false))
+ ?.summary;
+}

Powered by Google App Engine
This is Rietveld 408576698