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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const char* name, | 56 const char* name, |
57 v8::ActivityControl* control, | 57 v8::ActivityControl* control, |
58 v8::HeapProfiler::ObjectNameResolver* resolver); | 58 v8::HeapProfiler::ObjectNameResolver* resolver); |
59 HeapSnapshot* TakeSnapshot( | 59 HeapSnapshot* TakeSnapshot( |
60 String* name, | 60 String* name, |
61 v8::ActivityControl* control, | 61 v8::ActivityControl* control, |
62 v8::HeapProfiler::ObjectNameResolver* resolver); | 62 v8::HeapProfiler::ObjectNameResolver* resolver); |
63 | 63 |
64 void StartHeapObjectsTracking(); | 64 void StartHeapObjectsTracking(); |
65 void StopHeapObjectsTracking(); | 65 void StopHeapObjectsTracking(); |
| 66 |
| 67 static void RecordObjectAllocationFromMasm(Isolate* isolate, |
| 68 Address obj, |
| 69 int size); |
| 70 |
66 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); | 71 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); |
67 int GetSnapshotsCount(); | 72 int GetSnapshotsCount(); |
68 HeapSnapshot* GetSnapshot(int index); | 73 HeapSnapshot* GetSnapshot(int index); |
69 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); | 74 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); |
70 void DeleteAllSnapshots(); | 75 void DeleteAllSnapshots(); |
71 | 76 |
72 void ObjectMoveEvent(Address from, Address to); | 77 void ObjectMoveEvent(Address from, Address to, int size); |
| 78 |
| 79 void NewObjectEvent(Address addr, int size); |
73 | 80 |
74 void DefineWrapperClass( | 81 void DefineWrapperClass( |
75 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); | 82 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
76 | 83 |
77 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, | 84 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
78 Object** wrapper); | 85 Object** wrapper); |
79 INLINE(bool is_profiling()) { | 86 INLINE(bool is_profiling()) { |
80 return snapshots_->is_tracking_objects(); | 87 return snapshots_->is_tracking_objects(); |
81 } | 88 } |
82 | 89 |
83 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); | 90 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); |
84 | 91 |
| 92 bool is_tracking_allocations() { |
| 93 return is_tracking_allocations_; |
| 94 } |
| 95 |
| 96 bool* is_tracking_allocations_address(); |
| 97 |
| 98 void StartHeapAllocationsRecording(); |
| 99 void StopHeapAllocationsRecording(); |
| 100 |
| 101 int FindUntrackedObjects(); |
| 102 |
85 private: | 103 private: |
86 Heap* heap() const { return snapshots_->heap(); } | 104 Heap* heap() const { return snapshots_->heap(); } |
87 | 105 |
88 HeapSnapshotsCollection* snapshots_; | 106 HeapSnapshotsCollection* snapshots_; |
89 unsigned next_snapshot_uid_; | 107 unsigned next_snapshot_uid_; |
90 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 108 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
| 109 bool is_tracking_allocations_; |
91 }; | 110 }; |
92 | 111 |
93 } } // namespace v8::internal | 112 } } // namespace v8::internal |
94 | 113 |
95 #endif // V8_HEAP_PROFILER_H_ | 114 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |