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

Unified Diff: pkg/kernel/lib/transformations/treeshaker.dart

Issue 2904203003: Don't recreate CoreTypes in transformers. Pass it in. (Closed)
Patch Set: 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/treeshaker.dart
diff --git a/pkg/kernel/lib/transformations/treeshaker.dart b/pkg/kernel/lib/transformations/treeshaker.dart
index 1e762bda7155dedcc4143b229e91320ee1303820..bacc723231032200475cd103be2c0c5401cc4127 100644
--- a/pkg/kernel/lib/transformations/treeshaker.dart
+++ b/pkg/kernel/lib/transformations/treeshaker.dart
@@ -10,8 +10,10 @@ import '../core_types.dart';
import '../type_environment.dart';
import '../library_index.dart';
-Program transformProgram(Program program, {List<ProgramRoot> programRoots}) {
- new TreeShaker(program, programRoots: programRoots).transform(program);
+Program transformProgram(CoreTypes coreTypes, Program program,
+ {List<ProgramRoot> programRoots}) {
+ new TreeShaker(coreTypes, program, programRoots: programRoots)
+ .transform(program);
return program;
}
@@ -167,13 +169,12 @@ class TreeShaker {
/// the mirrors library.
bool get forceShaking => programRoots != null && programRoots.isNotEmpty;
- TreeShaker(Program program,
+ TreeShaker(CoreTypes coreTypes, Program program,
{ClassHierarchy hierarchy,
- CoreTypes coreTypes,
bool strongMode: false,
List<ProgramRoot> programRoots})
: this._internal(program, hierarchy ?? new ClassHierarchy(program),
- coreTypes ?? new CoreTypes(program), strongMode, programRoots);
+ coreTypes, strongMode, programRoots);
bool isMemberBodyUsed(Member member) {
return _usedMembers.containsKey(member);

Powered by Google App Engine
This is Rietveld 408576698