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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2962913002: Create an option to disable type inference and type promotion. (Closed)
Patch Set: Created 3 years, 6 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/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 8d7f4bf6f872c93b4a909ea341c452e6d2cf432a..05f1c75e8214639f78e7e889f5dc91541a266691 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -225,6 +225,35 @@ abstract class TypeInferrer {
void inferParameterInitializer(Expression initializer, DartType declaredType);
}
+/// Implementation of [TypeInferrer] which doesn't do any type inference.
+///
+/// This is intended for profiling, to ensure that type inference and type
+/// promotion do not slow down compilation too much.
+class TypeInferrerDisabled extends TypeInferrer {
+ @override
+ final typePromoter = new TypePromoterDisabled();
+
+ @override
+ String get uri => null;
+
+ @override
+ void inferFieldInitializer(DartType declaredType, Expression initializer) {}
+
+ @override
+ void inferFunctionBody(
+ DartType returnType, AsyncMarker asyncMarker, Statement body) {}
+
+ @override
+ void inferInitializer(Initializer initializer) {}
+
+ @override
+ void inferMetadata(List<Expression> annotations) {}
+
+ @override
+ void inferParameterInitializer(
+ Expression initializer, DartType declaredType) {}
+}
+
/// Derived class containing generic implementations of [TypeInferrer].
///
/// This class contains as much of the implementation of type inference as

Powered by Google App Engine
This is Rietveld 408576698