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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Issue 2902643002: Address follow up comments (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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_outline_shaker.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index b7ec22eb16116749c8b57b6734065754180da33f..162c8e7e1681f633b4b6d2258d25ceb8a968c0de 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -267,7 +267,9 @@ class KernelTarget extends TargetImplementation {
///
/// When [trimDependencies] is true, this also runs a tree-shaker that deletes
/// anything from the [DillTarget] that is not needed for the source program,
- /// this includes function bodies and types that are not reachable.
+ /// this includes function bodies and types that are not reachable. This
+ /// option is currently in flux and the internal implementation might change.
+ /// See [trimDependenciesInProgram] for more details.
///
/// If [verify], run the default kernel verification on the resulting program.
@override
@@ -375,8 +377,7 @@ class KernelTarget extends TargetImplementation {
Map<String, Source> uriToSource =
new Map<String, Source>.from(this.uriToSource);
- List<Library> extraLibraries = dillTarget.loader.libraries;
- libraries.addAll(extraLibraries);
+ libraries.addAll(dillTarget.loader.libraries);
// TODO(scheglov) Should we also somehow update `uriToSource`?
// uriToSource.addAll(binary.uriToSource);
@@ -684,6 +685,12 @@ class KernelTarget extends TargetImplementation {
/// Tree-shakes most code from the [dillTarget] by visiting all other
/// libraries in [_program] and marking the APIs from the [dillTarget]
/// libraries that are in use.
+ ///
+ /// Note: while it's likely we'll do some trimming of programs for modular
+ /// compilation, it is unclear at this time when and how that trimming should
+ /// happen. We are likely going to remove the extra visitor my either marking
+ /// things while code is built, or by handling tree-shaking after the fact
+ /// (e.g. during serialization).
trimDependenciesInProgram() {
var toShake =
dillTarget.loader.libraries.map((lib) => lib.importUri).toSet();
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_outline_shaker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698