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

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

Issue 1380723002: [heap] Remove unswept bytes counter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation Created 5 years, 3 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 | src/heap/spaces.h » ('j') | 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 d161b1853d8afb662193e416dfa471380f93164b..c3976e2db45fd53b6b818769e685eaf9b95f2ee6 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -569,9 +569,6 @@ void MarkCompactCollector::EnsureSweepingCompleted() {
RefillFreeList(heap()->paged_space(OLD_SPACE));
RefillFreeList(heap()->paged_space(CODE_SPACE));
RefillFreeList(heap()->paged_space(MAP_SPACE));
- heap()->paged_space(OLD_SPACE)->ResetUnsweptFreeBytes();
- heap()->paged_space(CODE_SPACE)->ResetUnsweptFreeBytes();
- heap()->paged_space(MAP_SPACE)->ResetUnsweptFreeBytes();
#ifdef VERIFY_HEAP
if (FLAG_verify_heap && !evacuation()) {
@@ -606,9 +603,8 @@ void MarkCompactCollector::RefillFreeList(PagedSpace* space) {
return;
}
- intptr_t freed_bytes = space->free_list()->Concatenate(free_list);
- space->AddToAccountingStats(freed_bytes);
- space->DecrementUnsweptFreeBytes(freed_bytes);
+ intptr_t added = space->free_list()->Concatenate(free_list);
+ space->accounting_stats_.IncreaseCapacity(added);
}
@@ -4354,9 +4350,9 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
PrintF("Sweeping 0x%" V8PRIxPTR " released page.\n",
reinterpret_cast<intptr_t>(p));
}
- // Adjust unswept free bytes because releasing a page expects said
+ // Adjust bytes allocated because releasing a page expects said
// counter to be accurate for unswept pages.
- space->IncreaseUnsweptFreeBytes(p);
+ space->accounting_stats_.AllocateBytes(p->area_size());
Hannes Payer (out of office) 2015/10/02 06:52:09 This seems to be non-logical. We do we account her
Michael Lippautz 2015/10/02 13:04:35 I agree, the change here is mechanical though. Rel
Hannes Payer (out of office) 2015/10/05 15:23:26 The logic is just broken Let's fix it right away.
Michael Lippautz 2015/10/07 13:15:39 Done. I removed the corresponding parts. ReleasePa
space->ReleasePage(p);
continue;
}
@@ -4390,7 +4386,8 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
reinterpret_cast<intptr_t>(p));
}
p->parallel_sweeping_state().SetValue(MemoryChunk::kSweepingPending);
- space->IncreaseUnsweptFreeBytes(p);
+ int to_sweep = p->area_size() - p->LiveBytes();
+ space->accounting_stats_.ShrinkSpace(to_sweep);
Hannes Payer (out of office) 2015/10/02 06:52:09 Here we are going to shrink the capacity, a lot. A
Michael Lippautz 2015/10/02 13:04:35 I changed Committed() and MaxCommitted() to be bas
}
space->set_end_of_unswept_pages(p);
break;
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698