Index: runtime/vm/aot_optimizer.cc |
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc |
index 8b66e4998ee786aebda3da2fce812d7ccea94451..f7c741dc11d73184e253f926d6c9d12792e71a75 100644 |
--- a/runtime/vm/aot_optimizer.cc |
+++ b/runtime/vm/aot_optimizer.cc |
@@ -2148,6 +2148,11 @@ static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, |
// TODO(srdjan): Use ICData to check if always true or false. |
void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) { |
ASSERT(Token::IsTypeTestOperator(call->token_kind())); |
+ // Guard against repeated speculative inlining. |
+ if (!use_speculative_inlining_ || |
+ IsBlackListedForInlining(call->deopt_id())) { |
+ return; |
+ } |
Definition* left = call->ArgumentAt(0); |
Definition* type_args = NULL; |
AbstractType& type = AbstractType::ZoneHandle(Z); |
@@ -2256,6 +2261,11 @@ void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) { |
// TODO(srdjan): Apply optimizations as in ReplaceWithInstanceOf (TestCids). |
void AotOptimizer::ReplaceWithTypeCast(InstanceCallInstr* call) { |
ASSERT(Token::IsTypeCastOperator(call->token_kind())); |
+ // Guard against repeated speculative inlining. |
+ if (!use_speculative_inlining_ || |
+ IsBlackListedForInlining(call->deopt_id())) { |
+ return; |
+ } |
Definition* left = call->ArgumentAt(0); |
Definition* type_args = call->ArgumentAt(1); |
const AbstractType& type = |