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

Unified Diff: runtime/vm/flow_graph_compiler_arm.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/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm.cc
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 700935b519616693699e0a33d7e8d2428d8d1db9..0caab79002ee8b0c0c953989beb9c85412fc91e5 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -1537,15 +1537,15 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
__ LoadObject(R4, arguments_descriptor);
const bool kFirstCheckIsSmi = ic_data.GetReceiverClassIdAt(0) == kSmiCid;
- const intptr_t kNumChecks = ic_data.NumberOfChecks();
+ const intptr_t num_checks = ic_data.NumberOfChecks();
- ASSERT(!ic_data.IsNull() && (kNumChecks > 0));
+ ASSERT(!ic_data.IsNull() && (num_checks > 0));
Label after_smi_test;
if (kFirstCheckIsSmi) {
__ tst(R0, Operand(kSmiTagMask));
// Jump if receiver is not Smi.
- if (kNumChecks == 1) {
+ if (num_checks == 1) {
__ b(failed, NE);
} else {
__ b(&after_smi_test, NE);
@@ -1558,7 +1558,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
*StubCode::CallStaticFunction_entry(),
RawPcDescriptors::kOther, locs, function);
__ Drop(argument_count);
- if (kNumChecks > 1) {
+ if (num_checks > 1) {
__ b(match_found);
}
} else {
@@ -1571,8 +1571,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
}
__ Bind(&after_smi_test);
- ASSERT(!ic_data.IsNull() && (kNumChecks > 0));
- GrowableArray<CidTarget> sorted(kNumChecks);
+ ASSERT(!ic_data.IsNull() && (num_checks > 0));
+ GrowableArray<CidTarget> sorted(num_checks);
SortICDataByCount(ic_data, &sorted, /* drop_smi = */ true);
// Value is not Smi,
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698