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

Unified Diff: runtime/vm/flow_graph_compiler_x64.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_mips.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 6c69c8062be31eaeab8bcd0b3e87eced12d3850d..1a29be51c2e3409778447c736722c4801831f80d 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1465,15 +1465,15 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
__ LoadObject(R10, 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) {
__ testq(RAX, Immediate(kSmiTagMask));
// Jump if receiver is not Smi.
- if (kNumChecks == 1) {
+ if (num_checks == 1) {
__ j(NOT_ZERO, failed);
} else {
__ j(NOT_ZERO, &after_smi_test);
@@ -1486,7 +1486,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
*StubCode::CallStaticFunction_entry(),
RawPcDescriptors::kOther, locs, function);
__ Drop(argument_count, RCX);
- if (kNumChecks > 1) {
+ if (num_checks > 1) {
__ jmp(match_found);
}
} else {
@@ -1499,8 +1499,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);
const intptr_t kSortedLen = sorted.length();
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698