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

Unified Diff: src/heap/heap.cc

Issue 1294763004: [heap] Hide GCTracer inside the heap component. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 3ae588f1dbadc7a58dd49c61b1f038092b8e4db6..92324c1bbda02c0f90bb4b0b5a1a7bc4e7e041c8 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -18,6 +18,7 @@
#include "src/deoptimizer.h"
#include "src/global-handles.h"
#include "src/heap/gc-idle-time-handler.h"
+#include "src/heap/gc-tracer.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact-inl.h"
#include "src/heap/mark-compact.h"
@@ -97,7 +98,7 @@ Heap::Heap()
inline_allocation_disabled_(false),
store_buffer_rebuilder_(store_buffer()),
total_regexp_code_generated_(0),
- tracer_(this),
+ tracer_(nullptr),
high_survival_rate_period_length_(0),
promoted_objects_size_(0),
promotion_ratio_(0),
@@ -5806,6 +5807,7 @@ bool Heap::SetUp() {
deferred_counters_[i] = 0;
}
+ tracer_ = new GCTracer(this);
LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity()));
LOG(isolate_, IntPtrTEvent("heap-available", Available()));
@@ -5878,8 +5880,9 @@ void Heap::TearDown() {
PrintF("total_gc_time=%.1f ", total_gc_time_ms_);
PrintF("min_in_mutator=%.1f ", get_min_in_mutator());
PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ", get_max_alive_after_gc());
- PrintF("total_marking_time=%.1f ", tracer_.cumulative_marking_duration());
- PrintF("total_sweeping_time=%.1f ", tracer_.cumulative_sweeping_duration());
+ PrintF("total_marking_time=%.1f ", tracer()->cumulative_marking_duration());
+ PrintF("total_sweeping_time=%.1f ",
+ tracer()->cumulative_sweeping_duration());
PrintF("\n\n");
}
@@ -5914,6 +5917,9 @@ void Heap::TearDown() {
mark_compact_collector()->TearDown();
+ delete tracer_;
+ tracer_ = nullptr;
+
new_space_.TearDown();
if (old_space_ != NULL) {
« src/heap/heap.h ('K') | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698