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

Unified Diff: pkg/kernel/lib/target/vm.dart

Issue 2669783002: Put tree-shaking behind a flag in dartk. (Closed)
Patch Set: Make named argument TargetFlags.treeShake default to false Created 3 years, 11 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/kernel/lib/target/targets.dart ('k') | tools/testing/dart/compiler_configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/target/vm.dart
diff --git a/pkg/kernel/lib/target/vm.dart b/pkg/kernel/lib/target/vm.dart
index d2643f5b5bdec5feaee1acb2cfc7e007806aa86b..8d4f84984614fc317537248fceb9ac9ab6d8efc6 100644
--- a/pkg/kernel/lib/target/vm.dart
+++ b/pkg/kernel/lib/target/vm.dart
@@ -4,6 +4,7 @@
library kernel.target.vm;
import '../ast.dart';
+import '../class_hierarchy.dart';
import '../core_types.dart';
import '../transformations/continuation.dart' as cont;
import '../transformations/erasure.dart';
@@ -55,8 +56,7 @@ class VmTarget extends Target {
];
void transformProgram(Program program) {
- var mixins = new mix.MixinFullResolution();
- mixins.transform(program);
+ var mixins = new mix.MixinFullResolution()..transform(program);
var hierarchy = mixins.hierarchy;
var coreTypes = new CoreTypes(program);
@@ -68,11 +68,13 @@ class VmTarget extends Target {
.transformProgram(program);
}
- if (program.mainMethod != null) {
+ if (flags.treeShake) {
new TreeShaker(program,
- hierarchy: hierarchy, coreTypes: coreTypes,
+ hierarchy: hierarchy,
+ coreTypes: coreTypes,
strongMode: strongMode)
.transform(program);
+ hierarchy = null; // Hierarchy must be recomputed.
}
cont.transformProgram(program);
« no previous file with comments | « pkg/kernel/lib/target/targets.dart ('k') | tools/testing/dart/compiler_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698