Commit 741c9552 authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Add specific timer events for finalizing incremental GCs.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#31103}
parent 62540192
......@@ -488,6 +488,9 @@ double AggregatedMemoryHistogram<Histogram>::Aggregate(double current_ms,
#define HISTOGRAM_TIMER_LIST(HT) \
/* Garbage collection timers. */ \
HT(gc_compactor, V8.GCCompactor, 10000, MILLISECOND) \
HT(gc_finalize, V8.GCFinalzeMC, 10000, MILLISECOND) \
HT(gc_finalize_reduce_memory, V8.GCFinalizeMCReduceMemory, 10000, \
MILLISECOND) \
HT(gc_scavenger, V8.GCScavenger, 10000, MILLISECOND) \
HT(gc_context, V8.GCContext, 10000, \
MILLISECOND) /* GC context cleanup time */ \
......
......@@ -819,6 +819,23 @@ void Heap::OverApproximateWeakClosure(const char* gc_reason) {
}
HistogramTimer* Heap::GCTypeTimer(GarbageCollector collector) {
if (collector == SCAVENGER) {
return isolate_->counters()->gc_scavenger();
} else {
if (!incremental_marking()->IsStopped()) {
if (ShouldReduceMemory()) {
return isolate_->counters()->gc_finalize_reduce_memory();
} else {
return isolate_->counters()->gc_finalize();
}
} else {
return isolate_->counters()->gc_compactor();
}
}
}
void Heap::CollectAllGarbage(int flags, const char* gc_reason,
const v8::GCCallbackFlags gc_callback_flags) {
// Since we are ignoring the return value, the exact choice of space does
......@@ -964,9 +981,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
GarbageCollectionPrologue();
{
HistogramTimerScope histogram_timer_scope(
(collector == SCAVENGER) ? isolate_->counters()->gc_scavenger()
: isolate_->counters()->gc_compactor());
HistogramTimerScope histogram_timer_scope(GCTypeTimer(collector));
next_gc_likely_to_collect_more =
PerformGarbageCollection(collector, gc_callback_flags);
}
......
......@@ -430,6 +430,7 @@ class GCIdleTimeHeapState;
class GCTracer;
class HeapObjectsFilter;
class HeapStats;
class HistogramTimer;
class Isolate;
class MemoryReducer;
class ObjectStats;
......@@ -1807,6 +1808,14 @@ class Heap {
// objects that die later.
void OverApproximateWeakClosure(const char* gc_reason);
// Returns the timer used for a given GC type.
// - GCScavenger: young generation GC
// - GCCompactor: full GC
// - GCFinalzeMC: finalization of incremental full GC
// - GCFinalizeMCReduceMemory: finalization of incremental full GC with
// memory reduction
HistogramTimer* GCTypeTimer(GarbageCollector collector);
// ===========================================================================
// Actual GC. ================================================================
// ===========================================================================
......
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