summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/cppgc/heap-statistics-collector.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/cppgc/heap-statistics-collector.h')
-rw-r--r--deps/v8/src/heap/cppgc/heap-statistics-collector.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/deps/v8/src/heap/cppgc/heap-statistics-collector.h b/deps/v8/src/heap/cppgc/heap-statistics-collector.h
index 52c92198a8..c0b1fe7c63 100644
--- a/deps/v8/src/heap/cppgc/heap-statistics-collector.h
+++ b/deps/v8/src/heap/cppgc/heap-statistics-collector.h
@@ -5,6 +5,8 @@
#ifndef V8_HEAP_CPPGC_HEAP_STATISTICS_COLLECTOR_H_
#define V8_HEAP_CPPGC_HEAP_STATISTICS_COLLECTOR_H_
+#include <unordered_map>
+
#include "include/cppgc/heap-statistics.h"
#include "src/heap/cppgc/heap-visitor.h"
@@ -15,18 +17,23 @@ class HeapStatisticsCollector : private HeapVisitor<HeapStatisticsCollector> {
friend class HeapVisitor<HeapStatisticsCollector>;
public:
- HeapStatistics CollectStatistics(HeapBase*);
+ HeapStatistics CollectDetailedStatistics(HeapBase*);
private:
- bool VisitNormalPageSpace(NormalPageSpace*);
- bool VisitLargePageSpace(LargePageSpace*);
- bool VisitNormalPage(NormalPage*);
- bool VisitLargePage(LargePage*);
- bool VisitHeapObjectHeader(HeapObjectHeader*);
+ bool VisitNormalPageSpace(NormalPageSpace&);
+ bool VisitLargePageSpace(LargePageSpace&);
+ bool VisitNormalPage(NormalPage&);
+ bool VisitLargePage(LargePage&);
+ bool VisitHeapObjectHeader(HeapObjectHeader&);
HeapStatistics* current_stats_;
HeapStatistics::SpaceStatistics* current_space_stats_ = nullptr;
HeapStatistics::PageStatistics* current_page_stats_ = nullptr;
+ // Index from type name to final index in `HeapStats::type_names`.
+ // Canonicalizing based on `const char*` assuming stable addresses. If the
+ // implementation of `NameProvider` decides to return different type name
+ // c-strings, the final outcome is less compact.
+ std::unordered_map<const char*, size_t> type_name_to_index_map_;
};
} // namespace internal