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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 2734883002: ICData::NumberOfChecks is O(n) so don't call it in loops (Closed)
Patch Set: Add const Created 3 years, 9 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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 4610cd6dbf4756c1397d3db1c2be6175ca99b81c..e1c8a0113e9743421e959d5441295684503e5f4a 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -161,13 +161,13 @@ bool FlowGraphCompiler::ShouldInlineSmiStringHashCode(const ICData& ic_data) {
return false;
}
// Precompiled code has no ICData, optimistically inline it.
- if (ic_data.IsNull() || (ic_data.NumberOfChecks() == 0)) {
+ if (ic_data.IsNull() || ic_data.NumberOfChecksIs(0)) {
return true;
}
// Check if OneByteString is hot enough.
const ICData& ic_data_sorted =
ICData::Handle(ic_data.AsUnaryClassChecksSortedByCount());
- ASSERT(ic_data_sorted.NumberOfChecks() > 0);
+ ASSERT(!ic_data_sorted.NumberOfChecksIs(0));
if (ic_data_sorted.GetReceiverClassIdAt(0) == kOneByteStringCid) {
const intptr_t total_count = ic_data_sorted.AggregateCount();
const intptr_t ratio = (ic_data_sorted.GetCountAt(0) * 100) / total_count;
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698