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

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

Issue 2904203003: Don't recreate CoreTypes in transformers. Pass it in. (Closed)
Patch Set: Don't create CoreTypes in createOutlines() on InputError. 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/kernel/lib/target/targets.dart ('k') | pkg/kernel/lib/target/vmcc.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 e8c7df1d5f7613e862dd20aa24a9d7c43b302f9f..03c3f31709422c5b5f53996244774909945d7123 100644
--- a/pkg/kernel/lib/target/vm.dart
+++ b/pkg/kernel/lib/target/vm.dart
@@ -56,28 +56,26 @@ class VmTarget extends Target {
ClassHierarchy _hierarchy;
- void performModularTransformations(Program program) {
- var mixins = new mix.MixinFullResolution(this)
+ void performModularTransformations(CoreTypes coreTypes, Program program) {
+ var mixins = new mix.MixinFullResolution(this, coreTypes)
..transform(program.libraries);
_hierarchy = mixins.hierarchy;
}
- void performGlobalTransformations(Program program) {
- var coreTypes = new CoreTypes(program);
-
+ void performGlobalTransformations(CoreTypes coreTypes, Program program) {
if (strongMode) {
- new InsertTypeChecks(hierarchy: _hierarchy, coreTypes: coreTypes)
+ new InsertTypeChecks(coreTypes, hierarchy: _hierarchy)
.transformProgram(program);
- new InsertCovarianceChecks(hierarchy: _hierarchy, coreTypes: coreTypes)
+ new InsertCovarianceChecks(coreTypes, hierarchy: _hierarchy)
.transformProgram(program);
}
if (flags.treeShake) {
- performTreeShaking(program);
+ performTreeShaking(coreTypes, program);
}
- cont.transformProgram(program);
+ cont.transformProgram(coreTypes, program);
if (strongMode) {
performErasure(program);
@@ -86,11 +84,9 @@ class VmTarget extends Target {
new SanitizeForVM().transform(program);
}
- void performTreeShaking(Program program) {
- var coreTypes = new CoreTypes(program);
- new TreeShaker(program,
+ void performTreeShaking(CoreTypes coreTypes, Program program) {
+ new TreeShaker(coreTypes, program,
hierarchy: _hierarchy,
- coreTypes: coreTypes,
strongMode: strongMode,
programRoots: flags.programRoots)
.transform(program);
« no previous file with comments | « pkg/kernel/lib/target/targets.dart ('k') | pkg/kernel/lib/target/vmcc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698