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

Unified Diff: src/heap/spaces.cc

Issue 1330463002: [not for landing, heap] Parallel compaction in main GC pause (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase: Remove obsolete changes 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 | « src/heap/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index a68db97395fcb8cf9cf660d93cf3adb3e725c3e5..2f71d456f86b64883b5fb1e94877925cec1a19dc 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -492,6 +492,7 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size,
chunk->progress_bar_ = 0;
chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base));
chunk->set_parallel_sweeping(SWEEPING_DONE);
+ chunk->parallel_compaction_.SetValue(kCompactingDone);
chunk->mutex_ = NULL;
chunk->available_in_small_free_list_ = 0;
chunk->available_in_medium_free_list_ = 0;
@@ -2258,6 +2259,30 @@ intptr_t FreeList::Concatenate(FreeList* free_list) {
}
+void FreeList::Divide(FreeList** free_lists_to_fill, size_t num) {
+ DCHECK(num > 0);
+ int size = 0;
+ FreeSpace* space = nullptr;
+ size_t cnt = 0;
+ while ((space = small_list_.PickNodeFromList(&size)) != nullptr) {
+ free_lists_to_fill[cnt % num]->small_list_.Free(space, size);
+ cnt++;
+ }
+ while ((space = medium_list_.PickNodeFromList(&size)) != nullptr) {
+ free_lists_to_fill[cnt % num]->medium_list_.Free(space, size);
+ cnt++;
+ }
+ while ((space = large_list_.PickNodeFromList(&size)) != nullptr) {
+ free_lists_to_fill[cnt % num]->large_list_.Free(space, size);
+ cnt++;
+ }
+ while ((space = huge_list_.PickNodeFromList(&size)) != nullptr) {
+ free_lists_to_fill[cnt % num]->huge_list_.Free(space, size);
+ cnt++;
+ }
+}
+
+
void FreeList::Reset() {
small_list_.Reset();
medium_list_.Reset();
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698