5#ifdef V8_ENABLE_PRECISE_ZONE_STATS
7#if (defined(__clang__) || defined(__GLIBCXX__)) && !defined(_MSC_VER)
21void TypeStats::MergeWith(
const TypeStats& other) {
22 for (
auto const& item : other.map_) {
23 Add(item.first, item.second);
29 Demangler() =
default;
35 const char* demangle(std::type_index type_id) {
36#if (defined(__clang__) || defined(__GLIBCXX__)) && !defined(_MSC_VER)
39 abi::__cxa_demangle(type_id.name(),
buffer_, &buffer_len_, &status);
46 return type_id.name();
51 size_t buffer_len_ = 0;
54void TypeStats::Dump()
const {
56 PrintF(
"===== TypeStats =====\n");
57 PrintF(
"-------------+--------------+------------+--------+--------------\n");
58 PrintF(
" alloc | dealloc | count | sizeof | name\n");
59 PrintF(
"-------------+--------------+------------+--------+--------------\n");
60 uint64_t total_allocation_count = 0;
61 uint64_t total_allocated_bytes = 0;
62 uint64_t total_deallocated_bytes = 0;
63 for (
auto const& item :
map_) {
64 const StatsEntry& entry = item.second;
65 total_allocation_count += entry.allocation_count;
66 total_allocated_bytes += entry.allocated_bytes;
67 total_deallocated_bytes += entry.deallocated_bytes;
68 PrintF(
"%12zu | %12zu | %10zu | %6zu | %s\n", entry.allocated_bytes,
69 entry.deallocated_bytes, entry.allocation_count, entry.instance_size,
70 d.demangle(item.first));
72 PrintF(
"%12" PRIu64
" | %12" PRIu64
" | %10" PRIu64
73 " | ===== TOTAL STATS =====\n",
74 total_allocated_bytes, total_deallocated_bytes,
75 total_allocation_count);
base::OwnedVector< uint8_t > buffer_
ZoneVector< RpoNumber > & result
void Add(RWDigits Z, Digits X, Digits Y)
void PrintF(const char *format,...)