Commit d556278f authored by ernstm@chromium.org's avatar ernstm@chromium.org

Always trace garbage collection events in GCTracer.

- always trace events in GCTracer, but only print stats when the command
  line flag is set.
- required to collect statistis that will be used to schedue garbage
  collection.
- we need to watch the perf bots after this lands, as it could regress
  performance.

R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/410413007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22613 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 47d6f32b
......@@ -78,8 +78,6 @@ GCTracer::GCTracer(Heap* heap)
void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
const char* collector_reason) {
if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
previous_ = current_;
if (current_.type == Event::MARK_COMPACTOR)
previous_mark_compactor_event_ = current_;
......@@ -106,8 +104,6 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
void GCTracer::Stop() {
if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
current_.end_time = base::OS::TimeCurrentMillis();
current_.end_object_size = heap_->SizeOfObjects();
current_.end_memory_size = heap_->isolate()->memory_allocator()->Size();
......@@ -122,6 +118,10 @@ void GCTracer::Stop() {
if (current_.type == Event::MARK_COMPACTOR)
longest_incremental_marking_step_ = 0.0;
// TODO(ernstm): move the code below out of GCTracer.
if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
double duration = current_.end_time - current_.start_time;
double spent_in_mutator = Max(current_.start_time - previous_.end_time, 0.0);
......
......@@ -866,12 +866,7 @@ void IncrementalMarking::Step(intptr_t allocated_bytes,
bytes_scanned_ += bytes_to_process;
double start = 0;
if (FLAG_trace_incremental_marking || FLAG_trace_gc ||
FLAG_print_cumulative_gc_stat) {
start = base::OS::TimeCurrentMillis();
}
double start = base::OS::TimeCurrentMillis();
if (state_ == SWEEPING) {
if (heap_->mark_compact_collector()->sweeping_in_progress() &&
......@@ -952,13 +947,10 @@ void IncrementalMarking::Step(intptr_t allocated_bytes,
}
}
if (FLAG_trace_incremental_marking || FLAG_trace_gc ||
FLAG_print_cumulative_gc_stat) {
double end = base::OS::TimeCurrentMillis();
double delta = (end - start);
heap_->tracer()->AddIncrementalMarkingStep(delta);
heap_->AddMarkingTime(delta);
}
double end = base::OS::TimeCurrentMillis();
double delta = (end - start);
heap_->tracer()->AddIncrementalMarkingStep(delta);
heap_->AddMarkingTime(delta);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment