53 ASSERT(unaccounted_bytes_ >= 0);
57 sorted[i] = &entries_[i];
59 qsort(sorted,
kNumEntries,
sizeof(Entry*), &CompareEntries);
61 intptr_t instruction_bytes = 0;
63 instruction_bytes += entries_[i].bytes;
65 intptr_t total = object_header_bytes_ + instruction_bytes +
66 unaccounted_bytes_ + alignment_bytes_;
67 float ftotal =
static_cast<float>(total) / 100.0;
72 Entry* entry = sorted[i];
73 const char*
name = entry->name;
74 intptr_t bytes = entry->bytes;
75 intptr_t
count = entry->count;
76 float percent = bytes / ftotal;
77 float avg =
static_cast<float>(bytes) /
count;
85 "%8.2f avg bytes/entry "
94 unaccounted_bytes_ / ftotal, unaccounted_bytes_);
96 alignment_bytes_ / ftotal, alignment_bytes_);
97 OS::PrintErr(
"%5.2f %% % 8" Pd " bytes instruction object header\n",
98 object_header_bytes_ / ftotal, object_header_bytes_);
100 instruction_bytes / ftotal, instruction_bytes);
102 OS::PrintErr(
"%5.2f %% % 8" Pd " bytes in total\n", total / ftotal, total);
104 OS::PrintErr(
"% 8" Pd " return-constant functions\n", return_const_count_);
105 OS::PrintErr(
"% 8" Pd " return-constant-with-load-field functions\n",
106 return_const_with_load_field_count_);
178 bool returns_constant =
true;
179 bool returns_const_with_load_field_ =
true;
182 intptr_t bytes = entries_[i].bytes;
183 stat->entries_[i].count += entries_[i].count;
185 stat->entries_[i].bytes += bytes;
186 if (i != CombinedCodeStatistics::kTagParallelMove &&
187 i != CombinedCodeStatistics::kTagDartReturn &&
188 i != CombinedCodeStatistics::kTagCheckStackOverflow &&
189 i != CombinedCodeStatistics::kTagCheckStackOverflowSlowPath) {
190 returns_constant =
false;
191 if (i != CombinedCodeStatistics::kTagLoadField &&
192 i != CombinedCodeStatistics::kTagTargetEntry &&
193 i != CombinedCodeStatistics::kTagJoinEntry) {
194 returns_const_with_load_field_ =
false;
199 stat->unaccounted_bytes_ += unaccounted_bytes_;
200 ASSERT(stat->unaccounted_bytes_ >= 0);
201 stat->alignment_bytes_ += alignment_bytes_;
204 if (returns_constant) stat->return_const_count_++;
205 if (returns_const_with_load_field_) {
206 stat->return_const_with_load_field_count_++;