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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 SnapshotObjectId HeapProfiler::PushHeapObjectsStatsImpl(OutputStream* stream) { | 161 SnapshotObjectId HeapProfiler::PushHeapObjectsStatsImpl(OutputStream* stream) { |
162 return snapshots_->PushHeapObjectsStats(stream); | 162 return snapshots_->PushHeapObjectsStats(stream); |
163 } | 163 } |
164 | 164 |
165 | 165 |
166 void HeapProfiler::StopHeapObjectsTrackingImpl() { | 166 void HeapProfiler::StopHeapObjectsTrackingImpl() { |
167 snapshots_->StopHeapObjectsTracking(); | 167 snapshots_->StopHeapObjectsTracking(); |
168 } | 168 } |
169 | 169 |
170 | 170 |
| 171 size_t HeapProfiler::GetMemorySizeUsedByProfiler() { |
| 172 HeapProfiler* profiler = Isolate::Current()->heap_profiler(); |
| 173 ASSERT(profiler != NULL); |
| 174 size_t size = profiler->snapshots_->GetUsedMemorySize(); |
| 175 return size; |
| 176 } |
| 177 |
| 178 |
171 int HeapProfiler::GetSnapshotsCount() { | 179 int HeapProfiler::GetSnapshotsCount() { |
172 HeapProfiler* profiler = Isolate::Current()->heap_profiler(); | 180 HeapProfiler* profiler = Isolate::Current()->heap_profiler(); |
173 ASSERT(profiler != NULL); | 181 ASSERT(profiler != NULL); |
174 return profiler->snapshots_->snapshots()->length(); | 182 return profiler->snapshots_->snapshots()->length(); |
175 } | 183 } |
176 | 184 |
177 | 185 |
178 HeapSnapshot* HeapProfiler::GetSnapshot(int index) { | 186 HeapSnapshot* HeapProfiler::GetSnapshot(int index) { |
179 HeapProfiler* profiler = Isolate::Current()->heap_profiler(); | 187 HeapProfiler* profiler = Isolate::Current()->heap_profiler(); |
180 ASSERT(profiler != NULL); | 188 ASSERT(profiler != NULL); |
(...skipping 23 matching lines...) Expand all Loading... |
204 profiler->ResetSnapshots(); | 212 profiler->ResetSnapshots(); |
205 } | 213 } |
206 | 214 |
207 | 215 |
208 void HeapProfiler::ObjectMoveEvent(Address from, Address to) { | 216 void HeapProfiler::ObjectMoveEvent(Address from, Address to) { |
209 snapshots_->ObjectMoveEvent(from, to); | 217 snapshots_->ObjectMoveEvent(from, to); |
210 } | 218 } |
211 | 219 |
212 | 220 |
213 } } // namespace v8::internal | 221 } } // namespace v8::internal |
OLD | NEW |