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

Unified Diff: pkg/kernel/lib/transformations/method_call.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/method_call.dart
diff --git a/pkg/kernel/lib/transformations/method_call.dart b/pkg/kernel/lib/transformations/method_call.dart
index 26ee679af01fb4aa45cf47c15093dc1fc953134f..1dda53b5691f0056e6dc5c1b5a47dce8900c31b1 100644
--- a/pkg/kernel/lib/transformations/method_call.dart
+++ b/pkg/kernel/lib/transformations/method_call.dart
@@ -53,12 +53,15 @@ import '../visitor.dart';
/// var b = new B();
/// b.foo(499, named1: 88);
/// }
-Program transformProgram(Program program, [debug = false]) {
- new MethodCallTransformer(debug).visitProgram(program);
+Program transformProgram(CoreTypes coreTypes, Program program,
+ [debug = false]) {
+ new MethodCallTransformer(coreTypes, debug).visitProgram(program);
return program;
}
class MethodCallTransformer extends Transformer {
+ final CoreTypes coreTypes;
+
/// Keep track of "visited" procedures and constructors to not visit already
/// visited stuff, nor visit newly created stubs.
Set<Member> _visited = new Set<Member>();
@@ -105,16 +108,14 @@ class MethodCallTransformer extends Transformer {
/// For noSuchMethod calls.
ClassHierarchy hierarchy;
- CoreTypes coreTypes;
Constructor _invocationMirrorConstructor; // cached
Procedure _listFrom; // cached
- MethodCallTransformer(this._debug);
+ MethodCallTransformer(this.coreTypes, this._debug);
@override
TreeNode visitProgram(Program node) {
hierarchy = new ClassHierarchy(node);
- coreTypes = new CoreTypes(node);
// First move body of all procedures that takes optional positional or named
// parameters and record which non-static procedure names have optional
« no previous file with comments | « pkg/kernel/lib/transformations/insert_type_checks.dart ('k') | pkg/kernel/lib/transformations/mixin_full_resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698