Index: runtime/vm/flow_graph_optimizer.cc |
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
index 1deef2e527bfaf5c35b8210dd27939d0a8e1ecb5..c51d95235459050703779b2154213b14c5bcb81b 100644 |
--- a/runtime/vm/flow_graph_optimizer.cc |
+++ b/runtime/vm/flow_graph_optimizer.cc |
@@ -1444,7 +1444,10 @@ bool FlowGraphOptimizer::TryInlineRecognizedMethod(intptr_t receiver_cid, |
case MethodRecognizer::kInt16ArraySetIndexed: |
case MethodRecognizer::kUint16ArraySetIndexed: |
// Optimistically assume Smi. |
- // TODO(srdjan): Check deopt reason to prevent repeated deoptimizations. |
+ if (ic_data.HasDeoptReason(ICData::kDeoptCheckSmi)) { |
+ // Optimistic assumption failed at least once. |
+ return false; |
+ } |
value_check = ic_data.AsUnaryClassChecksForCid(kSmiCid, target); |
return InlineSetIndexed(kind, target, call, receiver, token_pos, |
value_check, entry, last); |