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

Unified Diff: src/sweeper-thread.cc

Issue 12184016: Set unswept free bytes for concurent sweeper. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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
« src/sweeper-thread.h ('K') | « src/sweeper-thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sweeper-thread.cc
diff --git a/src/sweeper-thread.cc b/src/sweeper-thread.cc
index 7e31e6cb56da937def85328f31ee7ce6d45f5a3e..5e212fd7b6a5724046acea0f0c7c9d3973e4e006 100644
--- a/src/sweeper-thread.cc
+++ b/src/sweeper-thread.cc
@@ -75,16 +75,22 @@ void SweeperThread::Run() {
}
}
+
+intptr_t SweeperThread::StealMemory(PagedSpace* space, FreeList* free_list) {
+ intptr_t free_bytes = space->free_list()->Concatenate(free_list);
+ space->AddToAccountingStats(free_bytes);
+ space->DecreaseUnsweptFreeBytes(free_bytes);
Michael Starzinger 2013/02/28 13:09:52 As discussed offline: Let's move both (AddToAccoun
Hannes Payer (out of office) 2013/02/28 14:42:34 Done.
+ return free_bytes;
+}
+
+
intptr_t SweeperThread::StealMemory(PagedSpace* space) {
- intptr_t free_bytes = 0;
if (space->identity() == OLD_POINTER_SPACE) {
- free_bytes = space->free_list()->Concatenate(&free_list_old_pointer_space_);
- space->AddToAccountingStats(free_bytes);
+ return StealMemory(space, &free_list_old_pointer_space_);
} else if (space->identity() == OLD_DATA_SPACE) {
- free_bytes = space->free_list()->Concatenate(&free_list_old_data_space_);
- space->AddToAccountingStats(free_bytes);
+ return StealMemory(space, &free_list_old_data_space_);
}
- return free_bytes;
+ return 0;
}
void SweeperThread::Stop() {
« src/sweeper-thread.h ('K') | « src/sweeper-thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698