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

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

Issue 2671653003: Split the Kernel transformations into modular and global ones (Closed)
Patch Set: Revert inadvertent change 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 d2643f5b5bdec5feaee1acb2cfc7e007806aa86b..1bfae7ef7a0720642b7d7fb989651fdc536c19a3 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' show ClassHierarchy;
import '../core_types.dart';
import '../transformations/continuation.dart' as cont;
import '../transformations/erasure.dart';
@@ -54,23 +55,28 @@ class VmTarget extends Target {
'dart:io',
];
- void transformProgram(Program program) {
+ ClassHierarchy _hierarchy;
+
+ void performModularTransformations(Program program) {
var mixins = new mix.MixinFullResolution();
mixins.transform(program);
- var hierarchy = mixins.hierarchy;
+ _hierarchy = mixins.hierarchy;
+ }
+
+ void performGlobalTransformations(Program program) {
var coreTypes = new CoreTypes(program);
if (strongMode) {
- new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes)
+ new InsertTypeChecks(hierarchy: _hierarchy, coreTypes: coreTypes)
.transformProgram(program);
- new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes)
+ new InsertCovarianceChecks(hierarchy: _hierarchy, coreTypes: coreTypes)
.transformProgram(program);
}
if (program.mainMethod != null) {
new TreeShaker(program,
- hierarchy: hierarchy, coreTypes: coreTypes,
+ hierarchy: _hierarchy, coreTypes: coreTypes,
strongMode: strongMode)
.transform(program);
}

Powered by Google App Engine
This is Rietveld 408576698