Index: src/heap-profiler.cc |
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc |
index 6f993607cafaca4aa1f6f9df27f24cac84b143a5..3d8e3364c90a8be445052865cf000270962a7146 100644 |
--- a/src/heap-profiler.cc |
+++ b/src/heap-profiler.cc |
@@ -98,9 +98,14 @@ HeapSnapshot* HeapProfiler::TakeSnapshot( |
} |
-void HeapProfiler::StartHeapObjectsTracking() { |
- snapshots_->StartHeapObjectsTracking(); |
+void HeapProfiler::StartHeapObjectsTracking(bool track_allocations) { |
+ snapshots_->StartHeapObjectsTracking(track_allocations); |
is_tracking_object_moves_ = true; |
+ ASSERT(!is_tracking_allocations_); |
+ if (track_allocations) { |
+ heap()->DisableInlineAllocation(); |
+ is_tracking_allocations_ = true; |
+ } |
} |
@@ -111,6 +116,10 @@ SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream) { |
void HeapProfiler::StopHeapObjectsTracking() { |
snapshots_->StopHeapObjectsTracking(); |
+ if (is_tracking_allocations_) { |
+ heap()->EnableInlineAllocation(); |
+ is_tracking_allocations_ = false; |
+ } |
} |
@@ -158,18 +167,4 @@ void HeapProfiler::SetRetainedObjectInfo(UniqueId id, |
} |
-void HeapProfiler::StartHeapAllocationsRecording() { |
- StartHeapObjectsTracking(); |
- heap()->DisableInlineAllocation(); |
- is_tracking_allocations_ = true; |
-} |
- |
- |
-void HeapProfiler::StopHeapAllocationsRecording() { |
- StopHeapObjectsTracking(); |
- heap()->EnableInlineAllocation(); |
- is_tracking_allocations_ = false; |
-} |
- |
- |
} } // namespace v8::internal |