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

Unified Diff: src/heap.cc

Issue 11782028: Parallel and concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 401f4f7948adc09cb845390ef7f37036fa179aee..45db7dd065b5231df81003bff572a4530366340a 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -1273,7 +1273,14 @@ void Heap::Scavenge() {
incremental_marking()->PrepareForScavenge();
- AdvanceSweepers(static_cast<int>(new_space_.Size()));
+ MarkCompactCollector* mark_compact = mark_compact_collector();
+
+ if (!mark_compact->AreSweeperThreadsActivated()) {
+ AdvanceSweepers(static_cast<int>(new_space_.Size()));
+ } else if (FLAG_concurrent_sweeping) {
+ mark_compact->StealMemoryFromSweeperThreads(paged_space(OLD_DATA_SPACE));
+ mark_compact->StealMemoryFromSweeperThreads(paged_space(OLD_POINTER_SPACE));
+ }
Michael Starzinger 2013/01/28 16:30:18 What we actually wanna ensure here is that we made
Hannes Payer (out of office) 2013/01/30 10:11:27 Right, but this changes the current non-parallel n
// Flip the semispaces. After flipping, to space is empty, from space has
// live objects.
@@ -5374,7 +5381,8 @@ bool Heap::IdleNotification(int hint) {
Michael Starzinger 2013/01/28 16:30:18 I know it's not your change, but drop one of the t
Hannes Payer (out of office) 2013/01/30 10:11:27 Done.
if (incremental_marking()->IsStopped()) {
- if (!IsSweepingComplete() &&
+ if (!mark_compact_collector()->AreSweeperThreadsActivated() &&
+ !IsSweepingComplete() &&
!AdvanceSweepers(static_cast<int>(step_size))) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698