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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void DefineWrapperClass( | 76 void DefineWrapperClass( |
77 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); | 77 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
78 | 78 |
79 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, | 79 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
80 Object** wrapper); | 80 Object** wrapper); |
81 INLINE(bool is_profiling()) { | 81 INLINE(bool is_profiling()) { |
82 return snapshots_->is_tracking_objects(); | 82 return snapshots_->is_tracking_objects(); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 HeapProfiler(); | 86 explicit HeapProfiler(Heap* heap); |
87 ~HeapProfiler(); | 87 ~HeapProfiler(); |
88 HeapSnapshot* TakeSnapshotImpl( | 88 HeapSnapshot* TakeSnapshotImpl( |
89 const char* name, | 89 const char* name, |
90 int type, | 90 int type, |
91 v8::ActivityControl* control, | 91 v8::ActivityControl* control, |
92 v8::HeapProfiler::ObjectNameResolver* resolver); | 92 v8::HeapProfiler::ObjectNameResolver* resolver); |
93 HeapSnapshot* TakeSnapshotImpl( | 93 HeapSnapshot* TakeSnapshotImpl( |
94 String* name, | 94 String* name, |
95 int type, | 95 int type, |
96 v8::ActivityControl* control, | 96 v8::ActivityControl* control, |
97 v8::HeapProfiler::ObjectNameResolver* resolver); | 97 v8::HeapProfiler::ObjectNameResolver* resolver); |
98 void ResetSnapshots(); | 98 void ResetSnapshots(); |
99 | 99 |
100 void StartHeapObjectsTrackingImpl(); | 100 void StartHeapObjectsTrackingImpl(); |
101 void StopHeapObjectsTrackingImpl(); | 101 void StopHeapObjectsTrackingImpl(); |
102 SnapshotObjectId PushHeapObjectsStatsImpl(OutputStream* stream); | 102 SnapshotObjectId PushHeapObjectsStatsImpl(OutputStream* stream); |
103 | 103 |
| 104 Heap* heap() const { return snapshots_->heap(); } |
| 105 |
104 HeapSnapshotsCollection* snapshots_; | 106 HeapSnapshotsCollection* snapshots_; |
105 unsigned next_snapshot_uid_; | 107 unsigned next_snapshot_uid_; |
106 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 108 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
107 }; | 109 }; |
108 | 110 |
109 } } // namespace v8::internal | 111 } } // namespace v8::internal |
110 | 112 |
111 #endif // V8_HEAP_PROFILER_H_ | 113 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |