v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::ObjectStats Class Reference

#include <object-stats.h>

Collaboration diagram for v8::internal::ObjectStats:

Public Types

enum class  VirtualInstanceType { DEFINE_VIRTUAL_INSTANCE_TYPE , LAST_VIRTUAL_TYPE = WEAK_NEW_SPACE_OBJECT_TO_CODE_TYPE }
 

Public Member Functions

 ObjectStats (Heap *heap)
 
void ClearObjectStats (bool clear_last_time_stats=false)
 
void PrintJSON (const char *key)
 
void Dump (std::stringstream &stream)
 
void CheckpointObjectStats ()
 
void RecordObjectStats (InstanceType type, size_t size, size_t over_allocated=kNoOverAllocation)
 
void RecordVirtualObjectStats (VirtualInstanceType type, size_t size, size_t over_allocated)
 
size_t object_count_last_gc (size_t index)
 
size_t object_size_last_gc (size_t index)
 
Isolateisolate ()
 
Heapheap ()
 

Static Public Attributes

static const size_t kNoOverAllocation = 0
 
static constexpr int FIRST_VIRTUAL_TYPE = LAST_TYPE + 1
 
static constexpr int OBJECT_STATS_COUNT
 

Private Member Functions

void PrintKeyAndId (const char *key, int gc_count)
 
V8_NOINLINE void PrintInstanceTypeJSON (const char *key, int gc_count, const char *name, int index)
 
V8_NOINLINE void DumpInstanceTypeData (std::stringstream &stream, const char *name, int index)
 
int HistogramIndexFromSize (size_t size)
 

Private Attributes

Heapheap_
 
size_t object_counts_ [OBJECT_STATS_COUNT]
 
size_t object_counts_last_time_ [OBJECT_STATS_COUNT]
 
size_t object_sizes_ [OBJECT_STATS_COUNT]
 
size_t object_sizes_last_time_ [OBJECT_STATS_COUNT]
 
size_t over_allocated_ [OBJECT_STATS_COUNT]
 
size_t size_histogram_ [OBJECT_STATS_COUNT][kNumberOfBuckets]
 
size_t over_allocated_histogram_ [OBJECT_STATS_COUNT][kNumberOfBuckets]
 
size_t tagged_fields_count_
 
size_t embedder_fields_count_
 
size_t inobject_smi_fields_count_
 
size_t boxed_double_fields_count_
 
size_t string_data_count_
 
size_t raw_fields_count_
 

Static Private Attributes

static const int kFirstBucketShift = 5
 
static const int kLastBucketShift = 20
 
static const int kFirstBucket = 1 << kFirstBucketShift
 
static const int kLastBucket = 1 << kLastBucketShift
 
static const int kNumberOfBuckets = kLastBucketShift - kFirstBucketShift + 1
 
static const int kLastValueBucketIndex = kLastBucketShift - kFirstBucketShift
 

Friends

class ObjectStatsCollectorImpl
 

Detailed Description

Definition at line 95 of file object-stats.h.

Member Enumeration Documentation

◆ VirtualInstanceType

Enumerator
DEFINE_VIRTUAL_INSTANCE_TYPE 
LAST_VIRTUAL_TYPE 

Definition at line 102 of file object-stats.h.

Constructor & Destructor Documentation

◆ ObjectStats()

v8::internal::ObjectStats::ObjectStats ( Heap * heap)
inlineexplicit

Definition at line 99 of file object-stats.h.

Here is the call graph for this function:

Member Function Documentation

◆ CheckpointObjectStats()

void v8::internal::ObjectStats::CheckpointObjectStats ( )

Definition at line 338 of file object-stats.cc.

Here is the call graph for this function:

◆ ClearObjectStats()

void v8::internal::ObjectStats::ClearObjectStats ( bool clear_last_time_stats = false)

Definition at line 173 of file object-stats.cc.

Here is the caller graph for this function:

◆ Dump()

void v8::internal::ObjectStats::Dump ( std::stringstream & stream)

Definition at line 292 of file object-stats.cc.

Here is the call graph for this function:

◆ DumpInstanceTypeData()

void v8::internal::ObjectStats::DumpInstanceTypeData ( std::stringstream & stream,
const char * name,
int index )
private

Definition at line 278 of file object-stats.cc.

Here is the call graph for this function:

◆ heap()

Heap * v8::internal::ObjectStats::heap ( )
inline

Definition at line 137 of file object-stats.h.

Here is the caller graph for this function:

◆ HistogramIndexFromSize()

int v8::internal::ObjectStats::HistogramIndexFromSize ( size_t size)
private

Definition at line 354 of file object-stats.cc.

Here is the caller graph for this function:

◆ isolate()

Isolate * v8::internal::ObjectStats::isolate ( )

Definition at line 382 of file object-stats.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_count_last_gc()

size_t v8::internal::ObjectStats::object_count_last_gc ( size_t index)
inline

Definition at line 128 of file object-stats.h.

◆ object_size_last_gc()

size_t v8::internal::ObjectStats::object_size_last_gc ( size_t index)
inline

Definition at line 132 of file object-stats.h.

◆ PrintInstanceTypeJSON()

void v8::internal::ObjectStats::PrintInstanceTypeJSON ( const char * key,
int gc_count,
const char * name,
int index )
private

Definition at line 213 of file object-stats.cc.

Here is the call graph for this function:

◆ PrintJSON()

void v8::internal::ObjectStats::PrintJSON ( const char * key)

Definition at line 231 of file object-stats.cc.

Here is the call graph for this function:

◆ PrintKeyAndId()

void v8::internal::ObjectStats::PrintKeyAndId ( const char * key,
int gc_count )
private

Definition at line 208 of file object-stats.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecordObjectStats()

void v8::internal::ObjectStats::RecordObjectStats ( InstanceType type,
size_t size,
size_t over_allocated = kNoOverAllocation )

Definition at line 360 of file object-stats.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecordVirtualObjectStats()

void v8::internal::ObjectStats::RecordVirtualObjectStats ( VirtualInstanceType type,
size_t size,
size_t over_allocated )

Definition at line 370 of file object-stats.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ObjectStatsCollectorImpl

friend class ObjectStatsCollectorImpl
friend

Definition at line 176 of file object-stats.h.

Member Data Documentation

◆ boxed_double_fields_count_

size_t v8::internal::ObjectStats::boxed_double_fields_count_
private

Definition at line 172 of file object-stats.h.

◆ embedder_fields_count_

size_t v8::internal::ObjectStats::embedder_fields_count_
private

Definition at line 170 of file object-stats.h.

◆ FIRST_VIRTUAL_TYPE

int v8::internal::ObjectStats::FIRST_VIRTUAL_TYPE = LAST_TYPE + 1
staticconstexpr

Definition at line 112 of file object-stats.h.

◆ heap_

Heap* v8::internal::ObjectStats::heap_
private

Definition at line 157 of file object-stats.h.

◆ inobject_smi_fields_count_

size_t v8::internal::ObjectStats::inobject_smi_fields_count_
private

Definition at line 171 of file object-stats.h.

◆ kFirstBucket

const int v8::internal::ObjectStats::kFirstBucket = 1 << kFirstBucketShift
staticprivate

Definition at line 142 of file object-stats.h.

◆ kFirstBucketShift

const int v8::internal::ObjectStats::kFirstBucketShift = 5
staticprivate

Definition at line 140 of file object-stats.h.

◆ kLastBucket

const int v8::internal::ObjectStats::kLastBucket = 1 << kLastBucketShift
staticprivate

Definition at line 143 of file object-stats.h.

◆ kLastBucketShift

const int v8::internal::ObjectStats::kLastBucketShift = 20
staticprivate

Definition at line 141 of file object-stats.h.

◆ kLastValueBucketIndex

const int v8::internal::ObjectStats::kLastValueBucketIndex = kLastBucketShift - kFirstBucketShift
staticprivate

Definition at line 145 of file object-stats.h.

◆ kNoOverAllocation

const size_t v8::internal::ObjectStats::kNoOverAllocation = 0
static

Definition at line 97 of file object-stats.h.

◆ kNumberOfBuckets

const int v8::internal::ObjectStats::kNumberOfBuckets = kLastBucketShift - kFirstBucketShift + 1
staticprivate

Definition at line 144 of file object-stats.h.

◆ object_counts_

size_t v8::internal::ObjectStats::object_counts_[OBJECT_STATS_COUNT]
private

Definition at line 159 of file object-stats.h.

◆ object_counts_last_time_

size_t v8::internal::ObjectStats::object_counts_last_time_[OBJECT_STATS_COUNT]
private

Definition at line 160 of file object-stats.h.

◆ object_sizes_

size_t v8::internal::ObjectStats::object_sizes_[OBJECT_STATS_COUNT]
private

Definition at line 161 of file object-stats.h.

◆ object_sizes_last_time_

size_t v8::internal::ObjectStats::object_sizes_last_time_[OBJECT_STATS_COUNT]
private

Definition at line 162 of file object-stats.h.

◆ OBJECT_STATS_COUNT

int v8::internal::ObjectStats::OBJECT_STATS_COUNT
staticconstexpr
Initial value:

Definition at line 113 of file object-stats.h.

◆ over_allocated_

size_t v8::internal::ObjectStats::over_allocated_[OBJECT_STATS_COUNT]
private

Definition at line 164 of file object-stats.h.

◆ over_allocated_histogram_

size_t v8::internal::ObjectStats::over_allocated_histogram_[OBJECT_STATS_COUNT][kNumberOfBuckets]
private

Definition at line 167 of file object-stats.h.

◆ raw_fields_count_

size_t v8::internal::ObjectStats::raw_fields_count_
private

Definition at line 174 of file object-stats.h.

◆ size_histogram_

size_t v8::internal::ObjectStats::size_histogram_[OBJECT_STATS_COUNT][kNumberOfBuckets]
private

Definition at line 166 of file object-stats.h.

◆ string_data_count_

size_t v8::internal::ObjectStats::string_data_count_
private

Definition at line 173 of file object-stats.h.

◆ tagged_fields_count_

size_t v8::internal::ObjectStats::tagged_fields_count_
private

Definition at line 169 of file object-stats.h.


The documentation for this class was generated from the following files: