summaryrefslogtreecommitdiff
path: root/deps/v8/include
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/include')
-rw-r--r--deps/v8/include/v8-profiler.h32
-rw-r--r--deps/v8/include/v8.h40
2 files changed, 66 insertions, 6 deletions
diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h
index 9e3cb873c6..dd1b8caf7b 100644
--- a/deps/v8/include/v8-profiler.h
+++ b/deps/v8/include/v8-profiler.h
@@ -260,10 +260,17 @@ class V8EXPORT HeapGraphNode {
/**
* Returns node id. For the same heap object, the id remains the same
- * across all snapshots.
+ * across all snapshots. Not applicable to aggregated heap snapshots
+ * as they only contain aggregated instances.
*/
uint64_t GetId() const;
+ /**
+ * Returns the number of instances. Only applicable to aggregated
+ * heap snapshots.
+ */
+ int GetInstancesCount() const;
+
/** Returns node's own size, in bytes. */
int GetSelfSize() const;
@@ -313,6 +320,15 @@ class V8EXPORT HeapSnapshotsDiff {
*/
class V8EXPORT HeapSnapshot {
public:
+ enum Type {
+ kFull = 0, // Heap snapshot with all instances and references.
+ kAggregated = 1 // Snapshot doesn't contain individual heap entries,
+ //instead they are grouped by constructor name.
+ };
+
+ /** Returns heap snapshot type. */
+ Type GetType() const;
+
/** Returns heap snapshot UID (assigned by the profiler.) */
unsigned GetUid() const;
@@ -322,7 +338,10 @@ class V8EXPORT HeapSnapshot {
/** Returns the root node of the heap graph. */
const HeapGraphNode* GetRoot() const;
- /** Returns a diff between this snapshot and another one. */
+ /**
+ * Returns a diff between this snapshot and another one. Only snapshots
+ * of the same type can be compared.
+ */
const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const;
};
@@ -341,8 +360,13 @@ class V8EXPORT HeapProfiler {
/** Returns a profile by uid. */
static const HeapSnapshot* FindSnapshot(unsigned uid);
- /** Takes a heap snapshot and returns it. Title may be an empty string. */
- static const HeapSnapshot* TakeSnapshot(Handle<String> title);
+ /**
+ * Takes a heap snapshot and returns it. Title may be an empty string.
+ * See HeapSnapshot::Type for types description.
+ */
+ static const HeapSnapshot* TakeSnapshot(
+ Handle<String> title,
+ HeapSnapshot::Type type = HeapSnapshot::kFull);
};
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index ff73226925..b89c244ca2 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -1763,8 +1763,6 @@ class V8EXPORT AccessorInfo {
typedef Handle<Value> (*InvocationCallback)(const Arguments& args);
-typedef int (*LookupCallback)(Local<Object> self, Local<String> name);
-
/**
* NamedProperty[Getter|Setter] are used as interceptors on object.
* See ObjectTemplate::SetNamedPropertyHandler.
@@ -2361,6 +2359,30 @@ typedef void* (*CreateHistogramCallback)(const char* name,
typedef void (*AddHistogramSampleCallback)(void* histogram, int sample);
+// --- M e m o r y A l l o c a t i o n C a l l b a c k ---
+ enum ObjectSpace {
+ kObjectSpaceNewSpace = 1 << 0,
+ kObjectSpaceOldPointerSpace = 1 << 1,
+ kObjectSpaceOldDataSpace = 1 << 2,
+ kObjectSpaceCodeSpace = 1 << 3,
+ kObjectSpaceMapSpace = 1 << 4,
+ kObjectSpaceLoSpace = 1 << 5,
+
+ kObjectSpaceAll = kObjectSpaceNewSpace | kObjectSpaceOldPointerSpace |
+ kObjectSpaceOldDataSpace | kObjectSpaceCodeSpace | kObjectSpaceMapSpace |
+ kObjectSpaceLoSpace
+ };
+
+ enum AllocationAction {
+ kAllocationActionAllocate = 1 << 0,
+ kAllocationActionFree = 1 << 1,
+ kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
+ };
+
+typedef void (*MemoryAllocationCallback)(ObjectSpace space,
+ AllocationAction action,
+ int size);
+
// --- F a i l e d A c c e s s C h e c k C a l l b a c k ---
typedef void (*FailedAccessCheckCallback)(Local<Object> target,
AccessType type,
@@ -2581,6 +2603,20 @@ class V8EXPORT V8 {
static void SetGlobalGCEpilogueCallback(GCCallback);
/**
+ * Enables the host application to provide a mechanism to be notified
+ * and perform custom logging when V8 Allocates Executable Memory.
+ */
+ static void AddMemoryAllocationCallback(MemoryAllocationCallback callback,
+ ObjectSpace space,
+ AllocationAction action);
+
+ /**
+ * This function removes callback which was installed by
+ * AddMemoryAllocationCallback function.
+ */
+ static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback);
+
+ /**
* Allows the host application to group objects together. If one
* object in the group is alive, all objects in the group are alive.
* After each garbage collection, object groups are removed. It is