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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 17749004: Fix bot redness: max_calls can be zero if no call was actually executed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 24437)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -252,17 +252,15 @@
if (aggregate_count > max_count) max_count = aggregate_count;
}
-
+ // max_count can be 0 if none of the calls was executed.
for (intptr_t i = 0; i < num_instance_calls; ++i) {
- ASSERT(max_count > 0);
- const double ratio =
- static_cast<double>(instance_call_counts[i]) / max_count;
+ const double ratio = (max_count == 0) ?
+ 0.0 : static_cast<double>(instance_call_counts[i]) / max_count;
instance_calls_[i + instance_call_start_ix].ratio = ratio;
}
for (intptr_t i = 0; i < num_static_calls; ++i) {
- ASSERT(max_count > 0);
- const double ratio =
- static_cast<double>(static_call_counts[i]) / max_count;
+ const double ratio = (max_count == 0) ?
+ 0.0 : static_cast<double>(static_call_counts[i]) / max_count;
static_calls_[i + static_call_start_ix].ratio = ratio;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698