Commit b828be0d authored by ulan's avatar ulan Committed by Commit bot

[heap] Print more info in incremental marking tracing.

BUG=

Review-Url: https://codereview.chromium.org/2299543010
Cr-Commit-Position: refs/heads/master@{#39077}
parent ac0eb5e0
...@@ -964,7 +964,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason, ...@@ -964,7 +964,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
if (collector == SCAVENGER && !incremental_marking()->IsStopped()) { if (collector == SCAVENGER && !incremental_marking()->IsStopped()) {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Scavenge during marking.\n"); isolate()->PrintWithTimestamp(
"[IncrementalMarking] Scavenge during marking.\n");
} }
} }
...@@ -976,7 +977,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason, ...@@ -976,7 +977,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
!mark_compact_collector()->marking_deque_.IsEmpty() && !mark_compact_collector()->marking_deque_.IsEmpty() &&
!FLAG_gc_global) { !FLAG_gc_global) {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); isolate()->PrintWithTimestamp(
"[IncrementalMarking] Delaying MarkSweep.\n");
} }
collector = SCAVENGER; collector = SCAVENGER;
collector_reason = "incremental marking delaying mark-sweep"; collector_reason = "incremental marking delaying mark-sweep";
......
...@@ -487,9 +487,16 @@ static void PatchIncrementalMarkingRecordWriteStubs( ...@@ -487,9 +487,16 @@ static void PatchIncrementalMarkingRecordWriteStubs(
void IncrementalMarking::Start(const char* reason) { void IncrementalMarking::Start(const char* reason) {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
int old_generation_size_mb =
static_cast<int>(heap()->PromotedSpaceSizeOfObjects() / MB);
int old_generation_limit_mb =
static_cast<int>(heap()->old_generation_allocation_limit() / MB);
heap()->isolate()->PrintWithTimestamp( heap()->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Start (%s)\n", "[IncrementalMarking] Start (%s): old generation %dMB, limit %dMB, "
(reason == nullptr) ? "unknown reason" : reason); "slack %dMB\n",
(reason == nullptr) ? "unknown reason" : reason, old_generation_size_mb,
old_generation_limit_mb,
Max(0, old_generation_limit_mb - old_generation_size_mb));
} }
DCHECK(FLAG_incremental_marking); DCHECK(FLAG_incremental_marking);
DCHECK(state_ == STOPPED); DCHECK(state_ == STOPPED);
...@@ -959,7 +966,15 @@ void IncrementalMarking::Hurry() { ...@@ -959,7 +966,15 @@ void IncrementalMarking::Hurry() {
void IncrementalMarking::Stop() { void IncrementalMarking::Stop() {
if (IsStopped()) return; if (IsStopped()) return;
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Stopping.\n"); int old_generation_size_mb =
static_cast<int>(heap()->PromotedSpaceSizeOfObjects() / MB);
int old_generation_limit_mb =
static_cast<int>(heap()->old_generation_allocation_limit() / MB);
heap()->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Stopping: old generation %dMB, limit %dMB, "
"overshoot %dMB\n",
old_generation_size_mb, old_generation_limit_mb,
Max(0, old_generation_size_mb - old_generation_limit_mb));
} }
heap_->new_space()->RemoveAllocationObserver(&observer_); heap_->new_space()->RemoveAllocationObserver(&observer_);
......
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