Commit 7ad82f91 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Reformat and extend tracing compaction.

BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#31460}
parent 5520564c
...@@ -3404,7 +3404,8 @@ int MarkCompactCollector::NumberOfParallelCompactionTasks() { ...@@ -3404,7 +3404,8 @@ int MarkCompactCollector::NumberOfParallelCompactionTasks() {
void MarkCompactCollector::EvacuatePagesInParallel() { void MarkCompactCollector::EvacuatePagesInParallel() {
if (evacuation_candidates_.length() == 0) return; const int num_pages = evacuation_candidates_.length();
if (num_pages == 0) return;
const int num_tasks = NumberOfParallelCompactionTasks(); const int num_tasks = NumberOfParallelCompactionTasks();
...@@ -3445,7 +3446,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() { ...@@ -3445,7 +3446,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
delete[] compaction_spaces_for_tasks; delete[] compaction_spaces_for_tasks;
// Finalize sequentially. // Finalize sequentially.
const int num_pages = evacuation_candidates_.length();
int abandoned_pages = 0; int abandoned_pages = 0;
for (int i = 0; i < num_pages; i++) { for (int i = 0; i < num_pages; i++) {
Page* p = evacuation_candidates_[i]; Page* p = evacuation_candidates_[i];
...@@ -3481,17 +3481,13 @@ void MarkCompactCollector::EvacuatePagesInParallel() { ...@@ -3481,17 +3481,13 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
} }
p->parallel_compaction_state().SetValue(MemoryChunk::kCompactingDone); p->parallel_compaction_state().SetValue(MemoryChunk::kCompactingDone);
} }
if (num_pages > 0) {
if (FLAG_trace_fragmentation) { if (FLAG_trace_fragmentation) {
if (abandoned_pages != 0) { PrintIsolate(isolate(),
PrintF( "%8.0f ms: compaction: parallel=%d pages=%d aborted=%d "
" Abandoned (at least partially) %d out of %d page compactions due" "tasks=%d cores=%d\n",
" to lack of memory\n", isolate()->time_millis_since_init(), FLAG_parallel_compaction,
abandoned_pages, num_pages); num_pages, abandoned_pages, num_tasks,
} else { base::SysInfo::NumberOfProcessors());
PrintF(" Compacted %d pages\n", num_pages);
}
}
} }
} }
......
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