v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RetainedObjectInfo Class Referenceabstract

#include <v8-profiler.h>

Inheritance diagram for RetainedObjectInfo:

Public Member Functions

virtual void Dispose ()=0
 
virtual bool IsEquivalent (RetainedObjectInfo *other)=0
 
virtual intptr_t GetHash ()=0
 
virtual const char * GetLabel ()=0
 
virtual const char * GetGroupLabel ()
 
virtual intptr_t GetElementCount ()
 
virtual intptr_t GetSizeInBytes ()
 

Protected Member Functions

 RetainedObjectInfo ()
 
virtual ~RetainedObjectInfo ()
 

Detailed Description

Interface for providing information about embedder's objects held by global handles. This information is reported in two ways:

  1. When calling AddObjectGroup, an embedder may pass RetainedObjectInfo instance describing the group. To collect this information while taking a heap snapshot, V8 calls GC prologue and epilogue callbacks.
  2. When a heap snapshot is collected, V8 additionally requests RetainedObjectInfos for persistent handles that were not previously reported via AddObjectGroup.

Thus, if an embedder wants to provide information about native objects for heap snapshots, he can do it in a GC prologue handler, and / or by assigning wrapper class ids in the following way:

  1. Bind a callback to class id by calling DefineWrapperClass.
  2. Call SetWrapperClassId on certain persistent handles.

V8 takes ownership of RetainedObjectInfo instances passed to it and keeps them alive only during snapshot collection. Afterwards, they are freed by calling the Dispose class function.

Definition at line 515 of file v8-profiler.h.

Constructor & Destructor Documentation

RetainedObjectInfo ( )
inlineprotected

Definition at line 556 of file v8-profiler.h.

virtual ~RetainedObjectInfo ( )
inlineprotectedvirtual

Definition at line 557 of file v8-profiler.h.

Member Function Documentation

virtual void Dispose ( )
pure virtual
virtual intptr_t GetElementCount ( )
inlinevirtual

Returns element count in case if a global handle retains a subgraph by holding one of its nodes.

Definition at line 550 of file v8-profiler.h.

Referenced by BasicHeapEntriesAllocator::AllocateEntry(), and HeapObjectsMap::GenerateId().

virtual const char* GetGroupLabel ( )
inlinevirtual

Returns human-readable group label. It must be a null-terminated UTF-8 encoded string. V8 copies its contents during a call to GetGroupLabel. Heap snapshot generator will collect all the group names, create top level entries with these names and attach the objects to the corresponding top level group objects. There is a default implementation which is required because embedders don't have their own implementation yet.

Definition at line 544 of file v8-profiler.h.

virtual intptr_t GetHash ( )
pure virtual

Returns hash value for the instance. Equivalent instances must have the same hash value.

Implemented in NativeGroupRetainedObjectInfo, and TestRetainedObjectInfo.

Referenced by HeapObjectsMap::GenerateId(), and NativeGroupRetainedObjectInfo::IsEquivalent().

virtual const char* GetLabel ( )
pure virtual

Returns human-readable label. It must be a null-terminated UTF-8 encoded string. V8 copies its contents during a call to GetLabel.

Implemented in NativeGroupRetainedObjectInfo, and TestRetainedObjectInfo.

Referenced by BasicHeapEntriesAllocator::AllocateEntry(), HeapObjectsMap::GenerateId(), and NativeGroupRetainedObjectInfo::IsEquivalent().

virtual intptr_t GetSizeInBytes ( )
inlinevirtual

Returns embedder's object size in bytes.

Definition at line 553 of file v8-profiler.h.

Referenced by BasicHeapEntriesAllocator::AllocateEntry().

virtual bool IsEquivalent ( RetainedObjectInfo other)
pure virtual

Returns whether two instances are equivalent.

Implemented in NativeGroupRetainedObjectInfo, and TestRetainedObjectInfo.


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