Index: pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart |
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart b/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart |
index 8fccb03919a03e76bedd8ed55fa4b8692c2a33cb..94ab897e1293acb409e71db71295ad6daad4a107 100644 |
--- a/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart |
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart |
@@ -72,6 +72,44 @@ abstract class TypePromoter { |
void mutateVariable(VariableDeclaration variable, int functionNestingLevel); |
} |
+/// Implementation of [TypePromoter] which doesn't do any type promotion. |
+/// |
+/// This is intended for profiling, to ensure that type inference and type |
+/// promotion do not slow down compilation too much. |
+class TypePromoterDisabled extends TypePromoter { |
+ @override |
+ TypePromotionScope get currentScope => null; |
+ |
+ @override |
+ DartType computePromotedType(TypePromotionFact fact, TypePromotionScope scope, |
+ bool mutatedInClosure) => |
+ null; |
+ |
+ @override |
+ void enterElse() {} |
+ |
+ @override |
+ void enterThen(Expression condition) {} |
+ |
+ @override |
+ void exitConditional() {} |
+ |
+ @override |
+ void finished() {} |
+ |
+ @override |
+ TypePromotionFact getFactForAccess( |
+ VariableDeclaration variable, int functionNestingLevel) => |
+ null; |
+ |
+ @override |
+ void handleIsCheck(Expression isExpression, bool isInverted, |
+ VariableDeclaration variable, DartType type, int functionNestingLevel) {} |
+ |
+ @override |
+ void mutateVariable(VariableDeclaration variable, int functionNestingLevel) {} |
+} |
+ |
/// Derived class containing generic implementations of [TypePromoter]. |
/// |
/// This class contains as much of the implementation of type promotion as |