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

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

Issue 1415733004: Reland of "[heap] Divide available memory upon compaction tasks" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix size computation in TryRemoveMemory 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 | « src/heap/mark-compact.h ('k') | 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 69cf62124570538157e38e7529c349666b89c57d..f64ed35be1b37b0938c2e6dc74f10aff2f755a08 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -566,9 +566,9 @@ void MarkCompactCollector::EnsureSweepingCompleted() {
ParallelSweepSpacesComplete();
sweeping_in_progress_ = false;
- RefillFreeList(heap()->paged_space(OLD_SPACE));
- RefillFreeList(heap()->paged_space(CODE_SPACE));
- RefillFreeList(heap()->paged_space(MAP_SPACE));
+ heap()->old_space()->RefillFreeList();
+ heap()->code_space()->RefillFreeList();
+ heap()->map_space()->RefillFreeList();
#ifdef VERIFY_HEAP
if (FLAG_verify_heap && !evacuation()) {
@@ -588,26 +588,6 @@ bool MarkCompactCollector::IsSweepingCompleted() {
}
-void MarkCompactCollector::RefillFreeList(PagedSpace* space) {
- FreeList* free_list;
-
- if (space == heap()->old_space()) {
- free_list = free_list_old_space_.get();
- } else if (space == heap()->code_space()) {
- free_list = free_list_code_space_.get();
- } else if (space == heap()->map_space()) {
- free_list = free_list_map_space_.get();
- } else {
- // Any PagedSpace might invoke RefillFreeLists, so we need to make sure
- // to only refill them for the old space.
- return;
- }
-
- intptr_t added = space->free_list()->Concatenate(free_list);
- space->accounting_stats_.IncreaseCapacity(added);
-}
-
-
void Marking::TransferMark(Heap* heap, Address old_start, Address new_start) {
// This is only used when resizing an object.
DCHECK(MemoryChunk::FromAddress(old_start) ==
@@ -3435,11 +3415,10 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
compaction_spaces_for_tasks[i] = new CompactionSpaceCollection(heap());
}
- compaction_spaces_for_tasks[0]->Get(OLD_SPACE)->MoveOverFreeMemory(
- heap()->old_space());
- compaction_spaces_for_tasks[0]
- ->Get(CODE_SPACE)
- ->MoveOverFreeMemory(heap()->code_space());
+ heap()->old_space()->DivideUponCompactionSpaces(compaction_spaces_for_tasks,
+ num_tasks);
+ heap()->code_space()->DivideUponCompactionSpaces(compaction_spaces_for_tasks,
+ num_tasks);
compaction_in_progress_ = true;
// Kick off parallel tasks.
@@ -3451,9 +3430,7 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
}
// Contribute in main thread. Counter and signal are in principal not needed.
- concurrent_compaction_tasks_active_++;
EvacuatePages(compaction_spaces_for_tasks[0], &migration_slots_buffer_);
- pending_compaction_tasks_semaphore_.Signal();
WaitUntilCompactionCompleted();
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698