OLD | NEW |
1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-2010 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PROFILER_HEAP_PROFILER_H_ | 5 #ifndef V8_PROFILER_HEAP_PROFILER_H_ |
6 #define V8_PROFILER_HEAP_PROFILER_H_ | 6 #define V8_PROFILER_HEAP_PROFILER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void UpdateObjectSizeEvent(Address addr, int size); | 60 void UpdateObjectSizeEvent(Address addr, int size); |
61 | 61 |
62 void DefineWrapperClass( | 62 void DefineWrapperClass( |
63 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); | 63 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
64 | 64 |
65 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, | 65 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
66 Object** wrapper); | 66 Object** wrapper); |
67 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); | 67 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); |
68 | 68 |
| 69 void SetGetRetainerInfosCallback( |
| 70 v8::HeapProfiler::GetRetainerInfosCallback callback); |
| 71 |
| 72 v8::HeapProfiler::RetainerInfos GetRetainerInfos(Isolate* isolate); |
| 73 |
69 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } | 74 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } |
70 bool is_tracking_allocations() const { return !!allocation_tracker_; } | 75 bool is_tracking_allocations() const { return !!allocation_tracker_; } |
71 | 76 |
72 Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id); | 77 Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id); |
73 void ClearHeapObjectMap(); | 78 void ClearHeapObjectMap(); |
74 | 79 |
75 Isolate* isolate() const { return heap()->isolate(); } | 80 Isolate* isolate() const { return heap()->isolate(); } |
76 | 81 |
77 private: | 82 private: |
78 Heap* heap() const; | 83 Heap* heap() const; |
79 | 84 |
80 // Mapping from HeapObject addresses to objects' uids. | 85 // Mapping from HeapObject addresses to objects' uids. |
81 std::unique_ptr<HeapObjectsMap> ids_; | 86 std::unique_ptr<HeapObjectsMap> ids_; |
82 List<HeapSnapshot*> snapshots_; | 87 List<HeapSnapshot*> snapshots_; |
83 std::unique_ptr<StringsStorage> names_; | 88 std::unique_ptr<StringsStorage> names_; |
84 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 89 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
85 std::unique_ptr<AllocationTracker> allocation_tracker_; | 90 std::unique_ptr<AllocationTracker> allocation_tracker_; |
86 bool is_tracking_object_moves_; | 91 bool is_tracking_object_moves_; |
87 base::Mutex profiler_mutex_; | 92 base::Mutex profiler_mutex_; |
88 std::unique_ptr<SamplingHeapProfiler> sampling_heap_profiler_; | 93 std::unique_ptr<SamplingHeapProfiler> sampling_heap_profiler_; |
| 94 v8::HeapProfiler::GetRetainerInfosCallback get_retainer_infos_callback_; |
89 | 95 |
90 DISALLOW_COPY_AND_ASSIGN(HeapProfiler); | 96 DISALLOW_COPY_AND_ASSIGN(HeapProfiler); |
91 }; | 97 }; |
92 | 98 |
93 } // namespace internal | 99 } // namespace internal |
94 } // namespace v8 | 100 } // namespace v8 |
95 | 101 |
96 #endif // V8_PROFILER_HEAP_PROFILER_H_ | 102 #endif // V8_PROFILER_HEAP_PROFILER_H_ |
OLD | NEW |