Revision f230a1cf deps/v8/src/heap-profiler.h
deps/v8/src/heap-profiler.h | ||
---|---|---|
37 | 37 |
class HeapSnapshot; |
38 | 38 |
class HeapSnapshotsCollection; |
39 | 39 |
|
40 |
#define HEAP_PROFILE(heap, call) \ |
|
41 |
do { \ |
|
42 |
v8::internal::HeapProfiler* profiler = heap->isolate()->heap_profiler(); \ |
|
43 |
if (profiler != NULL && profiler->is_profiling()) { \ |
|
44 |
profiler->call; \ |
|
45 |
} \ |
|
46 |
} while (false) |
|
47 |
|
|
48 | 40 |
class HeapProfiler { |
49 | 41 |
public: |
50 | 42 |
explicit HeapProfiler(Heap* heap); |
... | ... | |
63 | 55 |
|
64 | 56 |
void StartHeapObjectsTracking(); |
65 | 57 |
void StopHeapObjectsTracking(); |
58 |
|
|
59 |
static void RecordObjectAllocationFromMasm(Isolate* isolate, |
|
60 |
Address obj, |
|
61 |
int size); |
|
62 |
|
|
66 | 63 |
SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); |
67 | 64 |
int GetSnapshotsCount(); |
68 | 65 |
HeapSnapshot* GetSnapshot(int index); |
69 | 66 |
SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); |
70 | 67 |
void DeleteAllSnapshots(); |
71 | 68 |
|
72 |
void ObjectMoveEvent(Address from, Address to); |
|
69 |
void ObjectMoveEvent(Address from, Address to, int size); |
|
70 |
|
|
71 |
void NewObjectEvent(Address addr, int size); |
|
72 |
|
|
73 |
void UpdateObjectSizeEvent(Address addr, int size); |
|
73 | 74 |
|
74 | 75 |
void DefineWrapperClass( |
75 | 76 |
uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
... | ... | |
82 | 83 |
|
83 | 84 |
void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); |
84 | 85 |
|
86 |
bool is_tracking_allocations() { |
|
87 |
return is_tracking_allocations_; |
|
88 |
} |
|
89 |
|
|
90 |
void StartHeapAllocationsRecording(); |
|
91 |
void StopHeapAllocationsRecording(); |
|
92 |
|
|
93 |
int FindUntrackedObjects() { |
|
94 |
return snapshots_->FindUntrackedObjects(); |
|
95 |
} |
|
96 |
|
|
97 |
void DropCompiledCode(); |
|
98 |
|
|
85 | 99 |
private: |
86 | 100 |
Heap* heap() const { return snapshots_->heap(); } |
87 | 101 |
|
88 | 102 |
HeapSnapshotsCollection* snapshots_; |
89 | 103 |
unsigned next_snapshot_uid_; |
90 | 104 |
List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
105 |
bool is_tracking_allocations_; |
|
91 | 106 |
}; |
92 | 107 |
|
93 | 108 |
} } // namespace v8::internal |
Also available in: Unified diff