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

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: 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
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..299d9691dfcf24f4a53b56c394dd140bfe66f7bd 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++) {
+ 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++) {

Powered by Google App Engine
This is Rietveld 408576698