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

#include <heap-profiler.h>

Inheritance diagram for v8::internal::HeapProfiler:
Collaboration diagram for v8::internal::HeapProfiler:

Public Member Functions

 HeapProfiler (Heap *heap)
 
 ~HeapProfiler () override
 
 HeapProfiler (const HeapProfiler &)=delete
 
HeapProfileroperator= (const HeapProfiler &)=delete
 
HeapSnapshotTakeSnapshot (const v8::HeapProfiler::HeapSnapshotOptions options)
 
void WriteSnapshotToDiskAfterGC (HeapSnapshotMode snapshot_mode=HeapSnapshotMode::kRegular)
 
void TakeSnapshotToFile (const v8::HeapProfiler::HeapSnapshotOptions options, std::string filename)
 
bool StartSamplingHeapProfiler (uint64_t sample_interval, int stack_depth, v8::HeapProfiler::SamplingFlags)
 
void StopSamplingHeapProfiler ()
 
bool is_sampling_allocations ()
 
AllocationProfileGetAllocationProfile ()
 
void StartHeapObjectsTracking (bool track_allocations)
 
void StopHeapObjectsTracking ()
 
AllocationTrackerallocation_tracker () const
 
HeapObjectsMapheap_object_map () const
 
StringsStoragenames () const
 
SnapshotObjectId PushHeapObjectsStats (OutputStream *stream, int64_t *timestamp_us)
 
int GetSnapshotsCount () const
 
bool IsTakingSnapshot () const
 
HeapSnapshotGetSnapshot (int index)
 
SnapshotObjectId GetSnapshotObjectId (DirectHandle< Object > obj)
 
SnapshotObjectId GetSnapshotObjectId (NativeObject obj)
 
void DeleteAllSnapshots ()
 
void RemoveSnapshot (HeapSnapshot *snapshot)
 
std::vector< v8::Local< v8::Value > > GetDetachedJSWrapperObjects ()
 
void ObjectMoveEvent (Address from, Address to, int size, bool is_native_object)
 
void AllocationEvent (Address addr, int size) override
 
void UpdateObjectSizeEvent (Address addr, int size) override
 
void AddBuildEmbedderGraphCallback (v8::HeapProfiler::BuildEmbedderGraphCallback callback, void *data)
 
void RemoveBuildEmbedderGraphCallback (v8::HeapProfiler::BuildEmbedderGraphCallback callback, void *data)
 
void BuildEmbedderGraph (Isolate *isolate, v8::EmbedderGraph *graph)
 
bool HasBuildEmbedderGraphCallback ()
 
void SetGetDetachednessCallback (v8::HeapProfiler::GetDetachednessCallback callback, void *data)
 
bool HasGetDetachednessCallback () const
 
v8::EmbedderGraph::Node::Detachedness GetDetachedness (const v8::Local< v8::Value > v8_value, uint16_t class_id)
 
const char * CopyNameForHeapSnapshot (const char *name)
 
bool is_tracking_object_moves () const
 
DirectHandle< HeapObjectFindHeapObjectById (SnapshotObjectId id)
 
void ClearHeapObjectMap ()
 
Isolateisolate () const
 
void QueryObjects (DirectHandle< Context > context, QueryObjectPredicate *predicate, std::vector< v8::Global< v8::Object > > *objects)
 
void set_native_move_listener (std::unique_ptr< HeapProfilerNativeMoveListener > listener)
 
- Public Member Functions inherited from v8::internal::HeapObjectAllocationTracker
virtual void MoveEvent (Address from, Address to, int size)
 
virtual ~HeapObjectAllocationTracker ()=default
 

Private Types

using HeapSnapshotMode = v8::HeapProfiler::HeapSnapshotMode
 

Private Member Functions

void MaybeClearStringsStorage ()
 
Heapheap () const
 

Private Attributes

std::unique_ptr< HeapObjectsMapids_
 
std::vector< std::unique_ptr< HeapSnapshot > > snapshots_
 
std::unique_ptr< StringsStoragenames_
 
std::unique_ptr< AllocationTrackerallocation_tracker_
 
bool is_tracking_object_moves_
 
bool is_taking_snapshot_
 
base::Mutex profiler_mutex_
 
std::unique_ptr< SamplingHeapProfilersampling_heap_profiler_
 
std::vector< std::pair< v8::HeapProfiler::BuildEmbedderGraphCallback, void * > > build_embedder_graph_callbacks_
 
std::pair< v8::HeapProfiler::GetDetachednessCallback, void * > get_detachedness_callback_
 
std::unique_ptr< HeapProfilerNativeMoveListenernative_move_listener_
 

Detailed Description

Definition at line 54 of file heap-profiler.h.

Member Typedef Documentation

◆ HeapSnapshotMode

Constructor & Destructor Documentation

◆ HeapProfiler() [1/2]

v8::internal::HeapProfiler::HeapProfiler ( Heap * heap)
explicit

Definition at line 24 of file heap-profiler.cc.

◆ ~HeapProfiler()

v8::internal::HeapProfiler::~HeapProfiler ( )
overridedefault

◆ HeapProfiler() [2/2]

v8::internal::HeapProfiler::HeapProfiler ( const HeapProfiler & )
delete

Member Function Documentation

◆ AddBuildEmbedderGraphCallback()

void v8::internal::HeapProfiler::AddBuildEmbedderGraphCallback ( v8::HeapProfiler::BuildEmbedderGraphCallback callback,
void * data )

Definition at line 79 of file heap-profiler.cc.

◆ allocation_tracker()

AllocationTracker * v8::internal::HeapProfiler::allocation_tracker ( ) const
inline

Definition at line 81 of file heap-profiler.h.

Here is the caller graph for this function:

◆ AllocationEvent()

void v8::internal::HeapProfiler::AllocationEvent ( Address addr,
int size )
overridevirtual

Implements v8::internal::HeapObjectAllocationTracker.

Definition at line 289 of file heap-profiler.cc.

◆ BuildEmbedderGraph()

void v8::internal::HeapProfiler::BuildEmbedderGraph ( Isolate * isolate,
v8::EmbedderGraph * graph )

Definition at line 93 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ ClearHeapObjectMap()

void v8::internal::HeapProfiler::ClearHeapObjectMap ( )

Definition at line 312 of file heap-profiler.cc.

Here is the call graph for this function:

◆ CopyNameForHeapSnapshot()

const char * v8::internal::HeapProfiler::CopyNameForHeapSnapshot ( const char * name)

Definition at line 113 of file heap-profiler.cc.

◆ DeleteAllSnapshots()

void v8::internal::HeapProfiler::DeleteAllSnapshots ( )

Definition at line 32 of file heap-profiler.cc.

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

◆ FindHeapObjectById()

DirectHandle< HeapObject > v8::internal::HeapProfiler::FindHeapObjectById ( SnapshotObjectId id)

Definition at line 300 of file heap-profiler.cc.

Here is the call graph for this function:

◆ GetAllocationProfile()

v8::AllocationProfile * v8::internal::HeapProfiler::GetAllocationProfile ( )

Definition at line 213 of file heap-profiler.cc.

◆ GetDetachedJSWrapperObjects()

std::vector< v8::Local< v8::Value > > v8::internal::HeapProfiler::GetDetachedJSWrapperObjects ( )

Definition at line 52 of file heap-profiler.cc.

Here is the call graph for this function:

◆ GetDetachedness()

v8::EmbedderGraph::Node::Detachedness v8::internal::HeapProfiler::GetDetachedness ( const v8::Local< v8::Value > v8_value,
uint16_t class_id )

Definition at line 105 of file heap-profiler.cc.

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

◆ GetSnapshot()

HeapSnapshot * v8::internal::HeapProfiler::GetSnapshot ( int index)

Definition at line 255 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ GetSnapshotObjectId() [1/2]

SnapshotObjectId v8::internal::HeapProfiler::GetSnapshotObjectId ( DirectHandle< Object > obj)

Definition at line 259 of file heap-profiler.cc.

Here is the call graph for this function:

◆ GetSnapshotObjectId() [2/2]

SnapshotObjectId v8::internal::HeapProfiler::GetSnapshotObjectId ( NativeObject obj)

Definition at line 264 of file heap-profiler.cc.

◆ GetSnapshotsCount()

int v8::internal::HeapProfiler::GetSnapshotsCount ( ) const

Definition at line 249 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ HasBuildEmbedderGraphCallback()

bool v8::internal::HeapProfiler::HasBuildEmbedderGraphCallback ( )
inline

Definition at line 111 of file heap-profiler.h.

Here is the caller graph for this function:

◆ HasGetDetachednessCallback()

bool v8::internal::HeapProfiler::HasGetDetachednessCallback ( ) const
inline

Definition at line 117 of file heap-profiler.h.

Here is the caller graph for this function:

◆ heap()

Heap * v8::internal::HeapProfiler::heap ( ) const
private

Definition at line 323 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ heap_object_map()

HeapObjectsMap * v8::internal::HeapProfiler::heap_object_map ( ) const
inline

Definition at line 84 of file heap-profiler.h.

Here is the caller graph for this function:

◆ is_sampling_allocations()

bool v8::internal::HeapProfiler::is_sampling_allocations ( )
inline

Definition at line 76 of file heap-profiler.h.

◆ is_tracking_object_moves()

bool v8::internal::HeapProfiler::is_tracking_object_moves ( ) const
inline

Definition at line 125 of file heap-profiler.h.

Here is the caller graph for this function:

◆ isolate()

Isolate * v8::internal::HeapProfiler::isolate ( ) const

Definition at line 325 of file heap-profiler.cc.

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

◆ IsTakingSnapshot()

bool v8::internal::HeapProfiler::IsTakingSnapshot ( ) const

Definition at line 253 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ MaybeClearStringsStorage()

void v8::internal::HeapProfiler::MaybeClearStringsStorage ( )
private

Definition at line 37 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ names()

StringsStorage * v8::internal::HeapProfiler::names ( ) const
inline

Definition at line 85 of file heap-profiler.h.

◆ ObjectMoveEvent()

void v8::internal::HeapProfiler::ObjectMoveEvent ( Address from,
Address to,
int size,
bool is_native_object )

Definition at line 280 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ operator=()

HeapProfiler & v8::internal::HeapProfiler::operator= ( const HeapProfiler & )
delete

◆ PushHeapObjectsStats()

SnapshotObjectId v8::internal::HeapProfiler::PushHeapObjectsStats ( OutputStream * stream,
int64_t * timestamp_us )

Definition at line 235 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ QueryObjects()

void v8::internal::HeapProfiler::QueryObjects ( DirectHandle< Context > context,
v8::QueryObjectPredicate * predicate,
std::vector< v8::Global< v8::Object > > * objects )

Definition at line 327 of file heap-profiler.cc.

Here is the call graph for this function:

◆ RemoveBuildEmbedderGraphCallback()

void v8::internal::HeapProfiler::RemoveBuildEmbedderGraphCallback ( v8::HeapProfiler::BuildEmbedderGraphCallback callback,
void * data )

Definition at line 84 of file heap-profiler.cc.

◆ RemoveSnapshot()

void v8::internal::HeapProfiler::RemoveSnapshot ( HeapSnapshot * snapshot)

Definition at line 44 of file heap-profiler.cc.

Here is the caller graph for this function:

◆ set_native_move_listener()

void v8::internal::HeapProfiler::set_native_move_listener ( std::unique_ptr< HeapProfilerNativeMoveListener > listener)
inline

Definition at line 135 of file heap-profiler.h.

Here is the call graph for this function:

◆ SetGetDetachednessCallback()

void v8::internal::HeapProfiler::SetGetDetachednessCallback ( v8::HeapProfiler::GetDetachednessCallback callback,
void * data )

Definition at line 100 of file heap-profiler.cc.

◆ StartHeapObjectsTracking()

void v8::internal::HeapProfiler::StartHeapObjectsTracking ( bool track_allocations)

Definition at line 221 of file heap-profiler.cc.

Here is the call graph for this function:

◆ StartSamplingHeapProfiler()

bool v8::internal::HeapProfiler::StartSamplingHeapProfiler ( uint64_t sample_interval,
int stack_depth,
v8::HeapProfiler::SamplingFlags flags )

Definition at line 199 of file heap-profiler.cc.

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

◆ StopHeapObjectsTracking()

void v8::internal::HeapProfiler::StopHeapObjectsTracking ( )

Definition at line 240 of file heap-profiler.cc.

Here is the call graph for this function:

◆ StopSamplingHeapProfiler()

void v8::internal::HeapProfiler::StopSamplingHeapProfiler ( )

Definition at line 208 of file heap-profiler.cc.

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

◆ TakeSnapshot()

HeapSnapshot * v8::internal::HeapProfiler::TakeSnapshot ( const v8::HeapProfiler::HeapSnapshotOptions options)

Definition at line 118 of file heap-profiler.cc.

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

◆ TakeSnapshotToFile()

void v8::internal::HeapProfiler::TakeSnapshotToFile ( const v8::HeapProfiler::HeapSnapshotOptions options,
std::string filename )

Definition at line 191 of file heap-profiler.cc.

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

◆ UpdateObjectSizeEvent()

void v8::internal::HeapProfiler::UpdateObjectSizeEvent ( Address addr,
int size )
overridevirtual

Reimplemented from v8::internal::HeapObjectAllocationTracker.

Definition at line 296 of file heap-profiler.cc.

◆ WriteSnapshotToDiskAfterGC()

void v8::internal::HeapProfiler::WriteSnapshotToDiskAfterGC ( HeapSnapshotMode snapshot_mode = HeapSnapshotMode::kRegular)

Definition at line 171 of file heap-profiler.cc.

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

Member Data Documentation

◆ allocation_tracker_

std::unique_ptr<AllocationTracker> v8::internal::HeapProfiler::allocation_tracker_
private

Definition at line 152 of file heap-profiler.h.

◆ build_embedder_graph_callbacks_

std::vector<std::pair<v8::HeapProfiler::BuildEmbedderGraphCallback, void*> > v8::internal::HeapProfiler::build_embedder_graph_callbacks_
private

Definition at line 158 of file heap-profiler.h.

◆ get_detachedness_callback_

std::pair<v8::HeapProfiler::GetDetachednessCallback, void*> v8::internal::HeapProfiler::get_detachedness_callback_
private

Definition at line 160 of file heap-profiler.h.

◆ ids_

std::unique_ptr<HeapObjectsMap> v8::internal::HeapProfiler::ids_
private

Definition at line 149 of file heap-profiler.h.

◆ is_taking_snapshot_

bool v8::internal::HeapProfiler::is_taking_snapshot_
private

Definition at line 154 of file heap-profiler.h.

◆ is_tracking_object_moves_

bool v8::internal::HeapProfiler::is_tracking_object_moves_
private

Definition at line 153 of file heap-profiler.h.

◆ names_

std::unique_ptr<StringsStorage> v8::internal::HeapProfiler::names_
private

Definition at line 151 of file heap-profiler.h.

◆ native_move_listener_

std::unique_ptr<HeapProfilerNativeMoveListener> v8::internal::HeapProfiler::native_move_listener_
private

Definition at line 161 of file heap-profiler.h.

◆ profiler_mutex_

base::Mutex v8::internal::HeapProfiler::profiler_mutex_
private

Definition at line 155 of file heap-profiler.h.

◆ sampling_heap_profiler_

std::unique_ptr<SamplingHeapProfiler> v8::internal::HeapProfiler::sampling_heap_profiler_
private

Definition at line 156 of file heap-profiler.h.

◆ snapshots_

std::vector<std::unique_ptr<HeapSnapshot> > v8::internal::HeapProfiler::snapshots_
private

Definition at line 150 of file heap-profiler.h.


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