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

Unified Diff: runtime/vm/dart_api_impl.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/code_generator.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 22fd888352b4e49cc8f7af6bc1bf6162d67485a8..4cad96c0a9fc4ffc251234c1f5d9ddb2f3061776 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -6573,8 +6573,8 @@ Dart_Handle Dart_SaveJITFeedback(uint8_t** buffer, intptr_t* buffer_length) {
intptr_t num_args_checked = ic_data_.NumArgsTested();
js_icdata.AddProperty("argsTested", num_args_checked);
JSONArray js_entries(&js_icdata, "entries");
- for (intptr_t check = 0; check < ic_data_.NumberOfChecks();
- check++) {
+ const intptr_t number_of_checks = ic_data_.NumberOfChecks();
+ for (intptr_t check = 0; check < number_of_checks; check++) {
GrowableArray<intptr_t> class_ids(num_args_checked);
ic_data_.GetClassIdsAt(check, &class_ids);
for (intptr_t k = 0; k < num_args_checked; k++) {
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698