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

Unified Diff: src/mark-compact.cc

Issue 143283002: Move the management of the already swept pages to MarkCompactCollector (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 7a76d1b334c4165e7e189713a908e982415e3046..d19df2bf58dd59e733bf38c2d66f26bd625cc2e4 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -348,6 +348,12 @@ static void VerifyNativeContextSeparation(Heap* heap) {
#endif
+void MarkCompactCollector::SetUp() {
+ free_list_old_data_space_.Reset(new FreeList(heap_->old_data_space()));
+ free_list_old_pointer_space_.Reset(new FreeList(heap_->old_pointer_space()));
+}
+
+
void MarkCompactCollector::TearDown() {
AbortCompaction();
}
@@ -586,10 +592,10 @@ void MarkCompactCollector::WaitUntilSweepingCompleted() {
intptr_t MarkCompactCollector::
StealMemoryFromSweeperThreads(PagedSpace* space) {
Hannes Payer (out of office) 2014/01/21 11:31:38 We should rename this function to e.g. RefillFreeL
- intptr_t freed_bytes = 0;
- for (int i = 0; i < isolate()->num_sweeper_threads(); i++) {
- freed_bytes += isolate()->sweeper_threads()[i]->StealMemory(space);
- }
+ FreeList* free_list = space == heap()->old_pointer_space()
+ ? free_list_old_pointer_space_.get()
+ : free_list_old_data_space_.get();
+ intptr_t freed_bytes = space->free_list()->Concatenate(free_list);
space->AddToAccountingStats(freed_bytes);
space->DecrementUnsweptFreeBytes(freed_bytes);
return freed_bytes;
@@ -3971,9 +3977,11 @@ intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space,
void MarkCompactCollector::SweepInParallel(PagedSpace* space,
- FreeList* private_free_list,
- FreeList* free_list) {
+ FreeList* private_free_list) {
PageIterator it(space);
+ FreeList* free_list = space == heap()->old_pointer_space()
+ ? free_list_old_pointer_space_.get()
+ : free_list_old_data_space_.get();
while (it.has_next()) {
Page* p = it.next();
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698