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

Unified Diff: src/gc-tracer.cc

Issue 410413007: Always trace garbage collection events in GCTracer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | src/incremental-marking.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gc-tracer.cc
diff --git a/src/gc-tracer.cc b/src/gc-tracer.cc
index 3b381b3ad9c0c4b1843311edbc57122a1a526da0..6119867692599d3e0340e734c80fbbfda7a126ab 100644
--- a/src/gc-tracer.cc
+++ b/src/gc-tracer.cc
@@ -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);
« no previous file with comments | « no previous file | src/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698