| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 848a48e2bdf10367ea2f5635dad1d222d8cbf663..be296a4998eef90f94aa6369b36f5d32235b4603 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);
|
| }
|
|
|
|
|
| @@ -4356,9 +4352,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());
|
| space->ReleasePage(p);
|
| continue;
|
| }
|
| @@ -4392,7 +4388,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);
|
| }
|
| space->set_end_of_unswept_pages(p);
|
| break;
|
|
|