Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/heap-profiler.cc

Issue 96933003: Simplify allocation tracker API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap-profiler.h ('k') | src/heap-snapshot-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/heap-profiler.h ('k') | src/heap-snapshot-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698