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

Unified Diff: src/mark-compact.cc

Issue 12449008: Consistently unlink evacuation candidates before sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 | « no previous file | no next file » | 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 fe0c685c6995ef39bd8ad6b3f74219194332b386..3f54be6ce38259cea42a85b49183a0e3963d83b9 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3776,17 +3776,15 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
Page* p = it.next();
ASSERT(p->parallel_sweeping() == 0);
+ ASSERT(!p->IsEvacuationCandidate());
+
// Clear sweeping flags indicating that marking bits are still intact.
p->ClearSweptPrecisely();
p->ClearSweptConservatively();
- if (p->IsEvacuationCandidate()) {
- ASSERT(evacuation_candidates_.length() > 0);
- continue;
- }
-
if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) {
// Will be processed in EvacuateNewSpaceAndCandidates.
+ ASSERT(evacuation_candidates_.length() > 0);
continue;
}
@@ -3896,6 +3894,11 @@ void MarkCompactCollector::SweepSpaces() {
if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE;
if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE;
if (sweep_precisely_) how_to_sweep = PRECISE;
+
+ // Unlink evacuation candidates before sweeper threads access the list of
+ // pages to avoid race condition.
+ UnlinkEvacuationCandidates();
+
// Noncompacting collections simply sweep the spaces to clear the mark
// bits and free the nonlive blocks (for old and map spaces). We sweep
// the map space last because freeing non-live maps overwrites them and
@@ -3905,10 +3908,6 @@ void MarkCompactCollector::SweepSpaces() {
SweepSpace(heap()->old_pointer_space(), how_to_sweep);
SweepSpace(heap()->old_data_space(), how_to_sweep);
- // Unlink evacuation candidates before sweeper threads access the list of
- // pages to avoid race condition.
- UnlinkEvacuationCandidates();
-
if (how_to_sweep == PARALLEL_CONSERVATIVE ||
how_to_sweep == CONCURRENT_CONSERVATIVE) {
// TODO(hpayer): fix race with concurrent sweeper
@@ -3934,6 +3933,7 @@ void MarkCompactCollector::SweepSpaces() {
// Deallocate unmarked objects and clear marked bits for marked objects.
heap_->lo_space()->FreeUnmarkedObjects();
+ // Deallocate evacuated candidate pages.
ReleaseEvacuationCandidates();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698