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

Unified Diff: src/heap/mark-compact.cc

Issue 1420803002: [heap] Reformat and extend tracing compaction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 69cf62124570538157e38e7529c349666b89c57d..17c4891143db11e1433a6cbec3228708f5974512 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3424,7 +3424,8 @@ int MarkCompactCollector::NumberOfParallelCompactionTasks() {
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();
@@ -3468,7 +3469,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
delete[] compaction_spaces_for_tasks;
// Finalize sequentially.
- const int num_pages = evacuation_candidates_.length();
int abandoned_pages = 0;
for (int i = 0; i < num_pages; i++) {
Page* p = evacuation_candidates_[i];
@@ -3504,17 +3504,13 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
}
p->parallel_compaction_state().SetValue(MemoryChunk::kCompactingDone);
}
- if (num_pages > 0) {
- if (FLAG_trace_fragmentation) {
- if (abandoned_pages != 0) {
- PrintF(
- " Abandoned (at least partially) %d out of %d page compactions due"
- " to lack of memory\n",
- abandoned_pages, num_pages);
- } else {
- PrintF(" Compacted %d pages\n", num_pages);
- }
- }
+ if (FLAG_trace_fragmentation) {
+ PrintIsolate(isolate(),
+ "%8.0f ms: compaction: parallel=%d pages=%d aborted=%d "
+ "tasks=%d cores=%d\n",
+ isolate()->time_millis_since_init(), FLAG_parallel_compaction,
+ num_pages, abandoned_pages, num_tasks,
+ base::SysInfo::NumberOfProcessors());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698