56 isolate_group->object_store()->megamorphic_cache_table());
57 if (
table.IsNull())
return;
58 intptr_t max_size = 0;
59 for (intptr_t i = 0; i <
table.Length(); i++) {
61 buckets = cache.buckets();
64 if (buckets.
Length() > max_size) {
65 max_size = buckets.
Length();
71 intptr_t* probe_counts =
new intptr_t[max_size];
72 intptr_t entry_count = 0;
73 intptr_t max_probe_count = 0;
74 for (intptr_t i = 0; i < max_size; i++) {
77 for (intptr_t i = 0; i <
table.Length(); i++) {
79 buckets = cache.buckets();
80 intptr_t mask = cache.mask();
81 intptr_t capacity = mask + 1;
82 for (intptr_t j = 0; j < capacity; j++) {
86 intptr_t probe_count = 0;
87 intptr_t probe_index =
94 if (probe_cid == class_id) {
97 probe_index = (probe_index + 1) & mask;
99 probe_counts[probe_count]++;
100 if (probe_count > max_probe_count) {
101 max_probe_count = probe_count;
107 intptr_t cumulative_entries = 0;
108 for (intptr_t i = 0; i <= max_probe_count; i++) {
109 cumulative_entries += probe_counts[i];
112 static_cast<double>(cumulative_entries) /
113 static_cast<double>(entry_count));
115 delete[] probe_counts;