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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.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_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index e0d5846f99a04d547e358cd1c7c25a0eba30be05..552ac80c8910ac889a35449af9947d0434e14db9 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1441,15 +1441,15 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
__ LoadObject(EDX, 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;
__ testl(EAX, Immediate(kSmiTagMask));
if (kFirstCheckIsSmi) {
// Jump if receiver is not Smi.
- if (kNumChecks == 1) {
+ if (num_checks == 1) {
__ j(NOT_ZERO, failed);
} else {
__ j(NOT_ZERO, &after_smi_test);
@@ -1463,7 +1463,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
Function::ZoneHandle(zone(), ic_data.GetTargetAt(0));
AddStaticCallTarget(function);
__ Drop(argument_count);
- if (kNumChecks > 1) {
+ if (num_checks > 1) {
__ jmp(match_found);
}
} else {
@@ -1473,8 +1473,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_arm64.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698