v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap-statistics-collector.h
Go to the documentation of this file.
1
// Copyright 2021 the V8 project authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef V8_HEAP_CPPGC_HEAP_STATISTICS_COLLECTOR_H_
6
#define V8_HEAP_CPPGC_HEAP_STATISTICS_COLLECTOR_H_
7
8
#include <unordered_map>
9
10
#include "
include/cppgc/heap-statistics.h
"
11
#include "
src/heap/cppgc/heap-visitor.h
"
12
13
namespace
cppgc
{
14
namespace
internal {
15
16
class
HeapStatisticsCollector
:
private
HeapVisitor
<HeapStatisticsCollector> {
17
friend
class
HeapVisitor
<
HeapStatisticsCollector
>;
18
19
public
:
20
HeapStatistics
CollectDetailedStatistics
(
HeapBase
*);
21
22
private
:
23
bool
VisitNormalPageSpace
(
NormalPageSpace
&);
24
bool
VisitLargePageSpace
(
LargePageSpace
&);
25
bool
VisitNormalPage
(
NormalPage
&);
26
bool
VisitLargePage
(
LargePage
&);
27
bool
VisitHeapObjectHeader
(
HeapObjectHeader
&);
28
29
HeapStatistics
*
current_stats_
;
30
HeapStatistics::SpaceStatistics
*
current_space_stats_
=
nullptr
;
31
HeapStatistics::PageStatistics
*
current_page_stats_
=
nullptr
;
32
// Index from type name to final index in `HeapStats::type_names`.
33
// Canonicalizing based on `const void*` assuming stable addresses. If the
34
// implementation of `NameProvider` decides to return different type name
35
// c-strings, the final outcome is less compact.
36
std::unordered_map<const void*, size_t>
type_name_to_index_map_
;
37
};
38
39
}
// namespace internal
40
}
// namespace cppgc
41
42
#endif
// V8_HEAP_CPPGC_HEAP_STATISTICS_COLLECTOR_H_
cppgc::internal::HeapBase
Definition
heap-base.h:82
cppgc::internal::HeapObjectHeader
Definition
heap-object-header.h:58
cppgc::internal::HeapStatisticsCollector
Definition
heap-statistics-collector.h:16
cppgc::internal::HeapStatisticsCollector::CollectDetailedStatistics
HeapStatistics CollectDetailedStatistics(HeapBase *)
Definition
heap-statistics-collector.cc:95
cppgc::internal::HeapStatisticsCollector::current_space_stats_
HeapStatistics::SpaceStatistics * current_space_stats_
Definition
heap-statistics-collector.h:30
cppgc::internal::HeapStatisticsCollector::VisitLargePage
bool VisitLargePage(LargePage &)
Definition
heap-statistics-collector.cc:159
cppgc::internal::HeapStatisticsCollector::current_page_stats_
HeapStatistics::PageStatistics * current_page_stats_
Definition
heap-statistics-collector.h:31
cppgc::internal::HeapStatisticsCollector::current_stats_
HeapStatistics * current_stats_
Definition
heap-statistics-collector.h:29
cppgc::internal::HeapStatisticsCollector::VisitNormalPage
bool VisitNormalPage(NormalPage &)
Definition
heap-statistics-collector.cc:148
cppgc::internal::HeapStatisticsCollector::VisitLargePageSpace
bool VisitLargePageSpace(LargePageSpace &)
Definition
heap-statistics-collector.cc:140
cppgc::internal::HeapStatisticsCollector::VisitNormalPageSpace
bool VisitNormalPageSpace(NormalPageSpace &)
Definition
heap-statistics-collector.cc:127
cppgc::internal::HeapStatisticsCollector::VisitHeapObjectHeader
bool VisitHeapObjectHeader(HeapObjectHeader &)
Definition
heap-statistics-collector.cc:171
cppgc::internal::HeapStatisticsCollector::type_name_to_index_map_
std::unordered_map< const void *, size_t > type_name_to_index_map_
Definition
heap-statistics-collector.h:36
cppgc::internal::HeapVisitor
Definition
heap-visitor.h:20
cppgc::internal::LargePageSpace
Definition
heap-space.h:116
cppgc::internal::LargePage
Definition
heap-page.h:256
cppgc::internal::NormalPageSpace
Definition
heap-space.h:68
cppgc::internal::NormalPage
Definition
heap-page.h:152
heap-visitor.h
heap-statistics.h
cppgc
Definition
cross-heap-remembered-set.h:14
cppgc::HeapStatistics::PageStatistics
Definition
heap-statistics.h:51
cppgc::HeapStatistics::SpaceStatistics
Definition
heap-statistics.h:84
cppgc::HeapStatistics
Definition
heap-statistics.h:19
src
heap
cppgc
heap-statistics-collector.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0