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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/heap-profiler.h" | 7 #include "src/heap-profiler.h" |
8 | 8 |
9 #include "src/allocation-tracker.h" | 9 #include "src/allocation-tracker.h" |
10 #include "src/heap-snapshot-generator-inl.h" | 10 #include "src/heap-snapshot-generator-inl.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 ids_->UpdateHeapObjectsMap(); | 84 ids_->UpdateHeapObjectsMap(); |
85 is_tracking_object_moves_ = true; | 85 is_tracking_object_moves_ = true; |
86 DCHECK(!is_tracking_allocations()); | 86 DCHECK(!is_tracking_allocations()); |
87 if (track_allocations) { | 87 if (track_allocations) { |
88 allocation_tracker_.Reset(new AllocationTracker(ids_.get(), names_.get())); | 88 allocation_tracker_.Reset(new AllocationTracker(ids_.get(), names_.get())); |
89 heap()->DisableInlineAllocation(); | 89 heap()->DisableInlineAllocation(); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 | 93 |
94 SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream) { | 94 SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream, |
95 return ids_->PushHeapObjectsStats(stream); | 95 int64_t* timestamp_us) { |
| 96 return ids_->PushHeapObjectsStats(stream, timestamp_us); |
96 } | 97 } |
97 | 98 |
98 | 99 |
99 void HeapProfiler::StopHeapObjectsTracking() { | 100 void HeapProfiler::StopHeapObjectsTracking() { |
100 ids_->StopHeapObjectsTracking(); | 101 ids_->StopHeapObjectsTracking(); |
101 if (is_tracking_allocations()) { | 102 if (is_tracking_allocations()) { |
102 allocation_tracker_.Reset(NULL); | 103 allocation_tracker_.Reset(NULL); |
103 heap()->EnableInlineAllocation(); | 104 heap()->EnableInlineAllocation(); |
104 } | 105 } |
105 } | 106 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 180 } |
180 | 181 |
181 | 182 |
182 void HeapProfiler::ClearHeapObjectMap() { | 183 void HeapProfiler::ClearHeapObjectMap() { |
183 ids_.Reset(new HeapObjectsMap(heap())); | 184 ids_.Reset(new HeapObjectsMap(heap())); |
184 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; | 185 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; |
185 } | 186 } |
186 | 187 |
187 | 188 |
188 } } // namespace v8::internal | 189 } } // namespace v8::internal |
OLD | NEW |