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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 1149403005: Prevent excessive deoptimization when optimistically assuming Smi in typed data stores. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: ws Created 5 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: 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);
« no previous file with comments | « runtime/vm/deferred_objects.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698