Index: src/heap/gc-tracer.cc |
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc |
index eb4885db47984ef419ed0d1312dfa14c305964cc..5f75501c3658a779618946c7b39806d5cb8bf56b 100644 |
--- a/src/heap/gc-tracer.cc |
+++ b/src/heap/gc-tracer.cc |
@@ -88,24 +88,14 @@ GCTracer::Event::Event(Type type, GarbageCollectionReason gc_reason, |
const char* GCTracer::Event::TypeName(bool short_name) const { |
switch (type) { |
case SCAVENGER: |
- if (short_name) { |
- return "s"; |
- } else { |
- return "Scavenge"; |
- } |
+ return (short_name) ? "s" : "Scavenge"; |
case MARK_COMPACTOR: |
case INCREMENTAL_MARK_COMPACTOR: |
- if (short_name) { |
- return "ms"; |
- } else { |
- return "Mark-sweep"; |
- } |
+ return (short_name) ? "ms" : "Mark-sweep"; |
+ case MINOR_MARK_COMPACTOR: |
+ return (short_name) ? "mmc" : "Minor Mark-Compact"; |
case START: |
- if (short_name) { |
- return "st"; |
- } else { |
- return "Start"; |
- } |
+ return (short_name) ? "st" : "Start"; |
} |
return "Unknown Event Type"; |
} |
@@ -116,6 +106,7 @@ GCTracer::GCTracer(Heap* heap) |
previous_(current_), |
incremental_marking_bytes_(0), |
incremental_marking_duration_(0.0), |
+ incremental_marking_start_time_(0.0), |
recorded_incremental_marking_speed_(0.0), |
allocation_time_ms_(0.0), |
new_space_allocation_counter_bytes_(0), |
@@ -165,6 +156,8 @@ void GCTracer::Start(GarbageCollector collector, |
if (collector == SCAVENGER) { |
ulan
2016/11/11 10:22:10
Nit: use switch statement.
Michael Lippautz
2016/11/11 10:38:22
Done.
|
current_ = Event(Event::SCAVENGER, gc_reason, collector_reason); |
+ } else if (collector == MINOR_MARK_COMPACTOR) { |
+ current_ = Event(Event::MINOR_MARK_COMPACTOR, gc_reason, collector_reason); |
} else if (collector == MARK_COMPACTOR) { |
if (heap_->incremental_marking()->WasActivated()) { |
current_ = |
@@ -194,7 +187,7 @@ void GCTracer::Start(GarbageCollector collector, |
Counters* counters = heap_->isolate()->counters(); |
- if (collector == SCAVENGER) { |
+ if (Heap::IsYoungGenerationCollector(collector)) { |
counters->scavenge_reason()->AddSample(static_cast<int>(gc_reason)); |
} else { |
counters->mark_compact_reason()->AddSample(static_cast<int>(gc_reason)); |
@@ -222,13 +215,18 @@ void GCTracer::Stop(GarbageCollector collector) { |
if (start_counter_ != 0) { |
heap_->isolate()->PrintWithTimestamp( |
"[Finished reentrant %s during %s.]\n", |
- collector == SCAVENGER ? "Scavenge" : "Mark-sweep", |
+ collector == SCAVENGER |
ulan
2016/11/11 10:22:10
Nit: maybe extract to a separate function.
Michael Lippautz
2016/11/11 10:38:22
Done.
|
+ ? "Scavenge" |
+ : (collector == MINOR_MARK_COMPACTOR) ? "Minor Mark-Compact" |
+ : "Mark-sweep", |
current_.TypeName(false)); |
return; |
} |
DCHECK(start_counter_ >= 0); |
DCHECK((collector == SCAVENGER && current_.type == Event::SCAVENGER) || |
+ (collector == MINOR_MARK_COMPACTOR && |
+ current_.type == Event::MINOR_MARK_COMPACTOR) || |
(collector == MARK_COMPACTOR && |
(current_.type == Event::MARK_COMPACTOR || |
current_.type == Event::INCREMENTAL_MARK_COMPACTOR))); |
@@ -500,6 +498,15 @@ void GCTracer::PrintNVP() const { |
NewSpaceAllocationThroughputInBytesPerMillisecond(), |
ContextDisposalRateInMilliseconds()); |
break; |
+ case Event::MINOR_MARK_COMPACTOR: |
+ heap_->isolate()->PrintWithTimestamp( |
+ "pause=%.1f " |
+ "mutator=%.1f " |
+ "gc=%s " |
+ "reduce_memory=%d\n", |
+ duration, spent_in_mutator, current_.TypeName(true), |
+ current_.reduce_memory); |
+ break; |
case Event::MARK_COMPACTOR: |
case Event::INCREMENTAL_MARK_COMPACTOR: |
heap_->isolate()->PrintWithTimestamp( |