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

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

Issue 2627723003: Improvements to the kernel tree shaker. (Closed)
Patch Set: Fix issue with async method whose body becomes tree shaken, but not its interface 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
Index: pkg/kernel/lib/target/vm.dart
diff --git a/pkg/kernel/lib/target/vm.dart b/pkg/kernel/lib/target/vm.dart
index 58c229dc14f26bf444fa29fba003d5a5de3d2320..c12403ec6384ba44464b0e0c2c02e6587ffc298a 100644
--- a/pkg/kernel/lib/target/vm.dart
+++ b/pkg/kernel/lib/target/vm.dart
@@ -12,6 +12,7 @@ import '../transformations/insert_type_checks.dart';
import '../transformations/mixin_full_resolution.dart' as mix;
import '../transformations/sanitize_for_vm.dart';
import '../transformations/setup_builtin_library.dart' as setup_builtin_library;
+import '../transformations/treeshaker.dart';
import 'targets.dart';
/// Specializes the kernel IR to the Dart VM.
@@ -57,15 +58,20 @@ class VmTarget extends Target {
var mixins = new mix.MixinFullResolution();
mixins.transform(program);
+ var hierarchy = mixins.hierarchy;
+ var coreTypes = new CoreTypes(program);
+
if (strongMode) {
- var hierarchy = mixins.hierarchy;
- var coreTypes = new CoreTypes(program);
new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes)
.transformProgram(program);
new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes)
.transformProgram(program);
}
+ new TreeShaker(program,
+ hierarchy: hierarchy, coreTypes: coreTypes, strongMode: strongMode)
+ .transform(program);
+
cont.transformProgram(program);
// Repair `_getMainClosure()` function in dart:_builtin.

Powered by Google App Engine
This is Rietveld 408576698