Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: include/v8.h

Issue 1113233002: Adding api to get last gc object statistics for chrome://tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing the comment with NumberOfTrackedHeapObjectTypes. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 910279b52e6b29828a87e25106dde376aecc4869..feb66b22f8a627ab599b69b3fc4dbafbab49f098 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4815,6 +4815,24 @@ class V8_EXPORT HeapSpaceStatistics {
};
+class V8_EXPORT HeapObjectStatistics {
+ public:
+ HeapObjectStatistics();
+ const char* object_type() { return object_type_; }
+ const char* object_sub_type() { return object_sub_type_; }
+ size_t object_count() { return object_count_; }
+ size_t object_size() { return object_size_; }
+
+ private:
+ const char* object_type_;
+ const char* object_sub_type_;
+ size_t object_count_;
+ size_t object_size_;
+
+ friend class Isolate;
+};
+
+
class RetainedObjectInfo;
@@ -5203,6 +5221,23 @@ class V8_EXPORT Isolate {
size_t index);
/**
+ * Returns the number of types of objects tracked in the heap at GC.
+ */
+ size_t NumberOfTrackedHeapObjectTypes();
+
+ /**
+ * Get statistics about objects in the heap.
+ *
+ * \param object_statistics The HeapObjectStatistics object to fill in
+ * statistics of objects of given type, which were live in the previous GC.
+ * \param type_index The index of the type of object to fill details about,
+ * which ranges from 0 to NumberOfTrackedHeapObjectTypes() - 1.
+ * \returns true on success.
+ */
+ bool GetHeapObjectStatisticsAtLastGC(HeapObjectStatistics* object_statistics,
+ size_t type_index);
+
+ /**
* Get a call stack sample from the isolate.
* \param state Execution state.
* \param frames Caller allocated buffer to store stack frames.
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698