Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 73e5e5c4ee0da19cdbbaf2e320c270b9743f72de..eb138403b870d033fea2f5bfecf7609c18ba0847 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -4813,6 +4813,22 @@ class V8_EXPORT HeapSpaceStatistics { |
| }; |
| +class V8_EXPORT HeapObjectStatistics { |
| + public: |
| + HeapObjectStatistics(); |
| + const char* object_type() { return object_type_; } |
| + size_t object_count() { return object_count_; } |
| + size_t object_size() { return object_size_; } |
|
ulan
2015/05/06 12:46:02
You probably also want a notion of sub-type or sec
ssid
2015/05/07 13:53:03
As discussed offline, the sub-types are just given
|
| + |
| + private: |
| + const char* object_type_; |
| + size_t object_count_; |
| + size_t object_size_; |
| + |
| + friend class Isolate; |
| +}; |
| + |
| + |
| class RetainedObjectInfo; |
| @@ -5201,6 +5217,23 @@ class V8_EXPORT Isolate { |
| size_t index); |
| /** |
| + * Returns the number of types of objects in the heap. |
| + */ |
| + size_t NumberOfHeapObjectsTypes(); |
|
ulan
2015/05/06 12:46:02
Strictly speaking this is not the number of heap o
ssid
2015/05/07 13:53:03
Done.
|
| + |
| + /** |
| + * 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 NumberOfHeapObjectsTypes() - 1. |
| + * \returns true on success. |
| + */ |
| + bool GetLastGcObjectStatistics(HeapObjectStatistics* object_statistics, |
|
ulan
2015/05/06 12:46:02
GetHeapObjectStatisticsAtLastGC(...) to be consist
ssid
2015/05/07 13:53:03
Done.
|
| + 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. |