![]() |
v8
3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
|
#include <v8-profiler.h>
Public Types | |
typedef RetainedObjectInfo *(* | WrapperInfoCallback )(uint16_t class_id, Handle< Value > wrapper) |
Static Public Member Functions | |
static int | GetSnapshotsCount () |
static const HeapSnapshot * | GetSnapshot (int index) |
static const HeapSnapshot * | FindSnapshot (unsigned uid) |
static SnapshotObjectId | GetSnapshotObjectId (Handle< Value > value) |
static const HeapSnapshot * | TakeSnapshot (Handle< String > title, HeapSnapshot::Type type=HeapSnapshot::kFull, ActivityControl *control=NULL) |
static void | StartHeapObjectsTracking () |
static SnapshotObjectId | PushHeapObjectsStats (OutputStream *stream) |
static void | StopHeapObjectsTracking () |
static void | DeleteAllSnapshots () |
static void | DefineWrapperClass (uint16_t class_id, WrapperInfoCallback callback) |
static int | GetPersistentHandleCount () |
static size_t | GetMemorySizeUsedByProfiler () |
Static Public Attributes | |
static const SnapshotObjectId | kUnknownObjectId = 0 |
static const uint16_t | kPersistentHandleNoClassId = 0 |
Interface for controlling heap profiling.
Definition at line 395 of file v8-profiler.h.
typedef RetainedObjectInfo*(* WrapperInfoCallback)(uint16_t class_id, Handle< Value > wrapper) |
Callback function invoked for obtaining RetainedObjectInfo for the given JavaScript wrapper object. It is prohibited to enter V8 while the callback is running: only getters on the handle and GetPointerFromInternalField on the objects are allowed.
Definition at line 404 of file v8-profiler.h.
|
static |
|
static |
Deletes all snapshots taken. All previously returned pointers to snapshots and their contents become invalid after this call.
Definition at line 6253 of file api.cc.
References HeapProfiler::DeleteAllSnapshots().
Referenced by TEST().
|
static |
Returns a profile by uid.
Definition at line 6197 of file api.cc.
References HeapProfiler::FindSnapshot().
Referenced by TEST().
|
static |
Returns memory used for profiler internal data and snapshots.
Definition at line 6273 of file api.cc.
References HeapProfiler::GetMemorySizeUsedByProfiler().
|
static |
Returns the number of currently existing persistent handles.
Definition at line 6267 of file api.cc.
References Isolate::global_handles(), and GlobalHandles::NumberOfGlobalHandles().
Referenced by TEST().
|
static |
Returns a snapshot by index.
Definition at line 6189 of file api.cc.
References HeapProfiler::GetSnapshot().
|
static |
Returns SnapshotObjectId for a heap object referenced by |value| if it has been seen by the heap profiler, kUnknownObjectId otherwise.
Definition at line 6205 of file api.cc.
References HeapProfiler::GetSnapshotObjectId(), and Utils::OpenHandle().
Referenced by TEST().
|
static |
Returns the number of snapshots taken.
Definition at line 6182 of file api.cc.
References HeapProfiler::GetSnapshotsCount().
Referenced by TEST().
|
static |
Adds a new time interval entry to the aggregated statistics array. The time interval entry contains information on the current heap objects population size. The method also updates aggregated statistics and reports updates for all previous time intervals via the OutputStream object. Updates on each time interval are provided as a stream of the HeapStatsUpdate structure instances. The return value of the function is the last seen heap object Id.
StartHeapObjectsTracking must be called before the first call to this method.
Definition at line 6246 of file api.cc.
References HeapProfiler::PushHeapObjectsStats().
|
static |
Starts tracking of heap objects population statistics. After calling this method, all heap objects relocations done by the garbage collector are being registered.
Definition at line 6232 of file api.cc.
References HeapProfiler::StartHeapObjectsTracking().
Referenced by TEST().
|
static |
Stops tracking of heap objects population statistics, cleans up all collected data. StartHeapObjectsTracking must be called again prior to calling PushHeapObjectsStats next time.
Definition at line 6239 of file api.cc.
References HeapProfiler::StopHeapObjectsTracking().
Referenced by TEST().
|
static |
Takes a heap snapshot and returns it. Title may be an empty string. See HeapSnapshot::Type for types description.
Definition at line 6213 of file api.cc.
References HeapSnapshot::kFull, Utils::OpenHandle(), HeapProfiler::TakeSnapshot(), and UNREACHABLE.
Referenced by HasWeakGlobalHandle(), and TEST().
|
static |
Default value of persistent handle class ID. Must not be used to define a class. Can be used to reset a class of a persistent handle.
Definition at line 481 of file v8-profiler.h.
Referenced by GlobalHandles::Node::Acquire(), HeapProfiler::DefineWrapperClass(), and GlobalHandles::Node::has_wrapper_class_id().
|
static |
A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return it in case heap profiler cannot find id for the object passed as parameter. HeapSnapshot::GetNodeById will always return NULL for such id.
Definition at line 426 of file v8-profiler.h.
Referenced by HeapProfiler::GetSnapshotObjectId(), and TEST().