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

Unified Diff: pkg/kernel/lib/transformations/mixin_full_resolution.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
Index: pkg/kernel/lib/transformations/mixin_full_resolution.dart
diff --git a/pkg/kernel/lib/transformations/mixin_full_resolution.dart b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
index 496c6b429c1f35f0ebea4f249ff24793447f18f4..65b92e097109de97a2d422d2a046c1eeb254a088 100644
--- a/pkg/kernel/lib/transformations/mixin_full_resolution.dart
+++ b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
@@ -10,8 +10,9 @@ import '../core_types.dart';
import '../target/targets.dart' show Target;
import '../type_algebra.dart';
-void transformLibraries(Target targetInfo, List<Library> libraries) {
- new MixinFullResolution(targetInfo).transform(libraries);
+void transformLibraries(
+ Target targetInfo, CoreTypes coreTypes, List<Library> libraries) {
+ new MixinFullResolution(targetInfo, coreTypes).transform(libraries);
}
/// Replaces all mixin applications with regular classes, cloning all fields
@@ -23,10 +24,10 @@ void transformLibraries(Target targetInfo, List<Library> libraries) {
class MixinFullResolution {
final Target targetInfo;
+ final CoreTypes coreTypes;
ClassHierarchy hierarchy;
- CoreTypes coreTypes;
- MixinFullResolution(this.targetInfo);
+ MixinFullResolution(this.targetInfo, this.coreTypes);
/// Transform the given new [libraries]. It is expected that all other
/// libraries have already been transformed.
@@ -50,7 +51,6 @@ class MixinFullResolution {
// and "coreTypes" outside and passing into the transformers.
var program = libraries.first.enclosingProgram;
hierarchy = new ClassHierarchy(program);
- coreTypes = new CoreTypes(program);
// Resolve all super call expressions and super initializers.
for (var library in libraries) {
« no previous file with comments | « pkg/kernel/lib/transformations/method_call.dart ('k') | pkg/kernel/lib/transformations/reify/reify_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698