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

Unified Diff: src/mark-compact.cc

Issue 12082101: Release evacuation candidates after parallel sweeper threads completed. (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
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.cc » ('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 5f22565fb9268a21bb5e548c9a74c8ed77067d82..bdbeaeaa152515e7d54b7464f1ee722baad3e2a0 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -535,7 +535,7 @@ void MarkCompactCollector::StartSweeperThreads() {
}
-void MarkCompactCollector::WaitUntilSweepingCompleted() {
+bool MarkCompactCollector::WaitUntilSweepingCompleted() {
Michael Starzinger 2013/02/21 12:22:09 Why do you return a boolean here? IMHO this makes
Hannes Payer (out of office) 2013/02/21 12:52:31 Done.
if (sweeping_pending_) {
for (int i = 0; i < FLAG_sweeper_threads; i++) {
heap()->isolate()->sweeper_threads()[i]->WaitForSweeperThread();
@@ -543,8 +543,9 @@ void MarkCompactCollector::WaitUntilSweepingCompleted() {
sweeping_pending_ = false;
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_DATA_SPACE));
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_POINTER_SPACE));
- heap()->FreeQueuedChunks();
+ return true;
}
+ return false;
}
@@ -568,6 +569,13 @@ bool MarkCompactCollector::IsConcurrentSweepingInProgress() {
}
+void MarkCompactCollector::FinalizeSweeping() {
+ ASSERT(sweeping_pending_ == false);
+ ReleaseEvacuationCandidates();
+ heap()->FreeQueuedChunks();
+}
+
+
void MarkCompactCollector::MarkInParallel() {
for (int i = 0; i < FLAG_marking_threads; i++) {
heap()->isolate()->marking_threads()[i]->StartMarking();
@@ -886,7 +894,9 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) {
if (AreSweeperThreadsActivated() && FLAG_concurrent_sweeping) {
// Instead of waiting we could also abort the sweeper threads here.
- WaitUntilSweepingCompleted();
+ if (WaitUntilSweepingCompleted()) {
+ FinalizeSweeping();
+ }
}
// Clear marking bits if incremental marking is aborted.
@@ -3280,6 +3290,11 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_);
ASSERT(migration_slots_buffer_ == NULL);
+}
+
+
+void MarkCompactCollector::ReleaseEvacuationCandidates() {
+ int npages = evacuation_candidates_.length();
for (int i = 0; i < npages; i++) {
Page* p = evacuation_candidates_[i];
if (!p->IsEvacuationCandidate()) continue;
@@ -3877,6 +3892,10 @@ void MarkCompactCollector::SweepSpaces() {
// Deallocate unmarked objects and clear marked bits for marked objects.
heap_->lo_space()->FreeUnmarkedObjects();
+
+ if (!FLAG_concurrent_sweeping) {
Michael Starzinger 2013/02/21 12:22:09 This is still not entirely correct, it _has_ to de
Hannes Payer (out of office) 2013/02/21 12:52:31 Done.
+ FinalizeSweeping();
+ }
}
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698