Revision: 13708
Author: [email protected]
Date: Thu Feb 21 05:12:12 2013
Log: Release evacuation candidates after parallel sweeper threads
completed.
BUG=
Review URL: https://codereview.chromium.org/12082101
http://code.google.com/p/v8/source/detail?r=13708
Modified:
/branches/bleeding_edge/src/mark-compact.cc
/branches/bleeding_edge/src/mark-compact.h
/branches/bleeding_edge/src/spaces.cc
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Wed Feb 20 03:49:54 2013
+++ /branches/bleeding_edge/src/mark-compact.cc Thu Feb 21 05:12:12 2013
@@ -557,7 +557,6 @@
sweeping_pending_ = false;
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_DATA_SPACE));
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_POINTER_SPACE));
- heap()->FreeQueuedChunks();
}
}
@@ -580,6 +579,13 @@
bool MarkCompactCollector::IsConcurrentSweepingInProgress() {
return sweeping_pending_;
}
+
+
+void MarkCompactCollector::FinalizeSweeping() {
+ ASSERT(sweeping_pending_ == false);
+ ReleaseEvacuationCandidates();
+ heap()->FreeQueuedChunks();
+}
void MarkCompactCollector::MarkInParallel() {
@@ -901,6 +907,7 @@
if (AreSweeperThreadsActivated() && FLAG_concurrent_sweeping) {
// Instead of waiting we could also abort the sweeper threads here.
WaitUntilSweepingCompleted();
+ FinalizeSweeping();
}
// Clear marking bits if incremental marking is aborted.
@@ -3305,6 +3312,11 @@
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;
@@ -3749,7 +3761,8 @@
void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType
sweeper) {
space->set_was_swept_conservatively(sweeper == CONSERVATIVE ||
sweeper == LAZY_CONSERVATIVE ||
- sweeper == PARALLEL_CONSERVATIVE);
+ sweeper == PARALLEL_CONSERVATIVE ||
+ sweeper == CONCURRENT_CONSERVATIVE);
space->ClearStats();
PageIterator it(space);
@@ -3823,6 +3836,7 @@
lazy_sweeping_active = true;
break;
}
+ case CONCURRENT_CONSERVATIVE:
case PARALLEL_CONSERVATIVE: {
if (FLAG_gc_verbose) {
PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n",
@@ -3868,7 +3882,8 @@
#endif
SweeperType how_to_sweep =
FLAG_lazy_sweeping ? LAZY_CONSERVATIVE : CONSERVATIVE;
- if (AreSweeperThreadsActivated()) how_to_sweep = PARALLEL_CONSERVATIVE;
+ if (FLAG_parallel_sweeping) how_to_sweep = PARALLEL_CONSERVATIVE;
+ if (FLAG_concurrent_sweeping) how_to_sweep = CONCURRENT_CONSERVATIVE;
if (FLAG_expose_gc) how_to_sweep = CONSERVATIVE;
if (sweep_precisely_) how_to_sweep = PRECISE;
// Noncompacting collections simply sweep the spaces to clear the mark
@@ -3880,12 +3895,14 @@
SweepSpace(heap()->old_pointer_space(), how_to_sweep);
SweepSpace(heap()->old_data_space(), how_to_sweep);
- if (how_to_sweep == PARALLEL_CONSERVATIVE) {
+ if (how_to_sweep == PARALLEL_CONSERVATIVE ||
+ how_to_sweep == CONCURRENT_CONSERVATIVE) {
// TODO(hpayer): fix race with concurrent sweeper
StartSweeperThreads();
- if (FLAG_parallel_sweeping && !FLAG_concurrent_sweeping) {
- WaitUntilSweepingCompleted();
- }
+ }
+
+ if (how_to_sweep == PARALLEL_CONSERVATIVE) {
+ WaitUntilSweepingCompleted();
}
RemoveDeadInvalidatedCode();
@@ -3902,6 +3919,10 @@
// Deallocate unmarked objects and clear marked bits for marked objects.
heap_->lo_space()->FreeUnmarkedObjects();
+
+ if (how_to_sweep != CONCURRENT_CONSERVATIVE) {
+ FinalizeSweeping();
+ }
}
=======================================
--- /branches/bleeding_edge/src/mark-compact.h Wed Feb 20 03:49:54 2013
+++ /branches/bleeding_edge/src/mark-compact.h Thu Feb 21 05:12:12 2013
@@ -595,6 +595,7 @@
CONSERVATIVE,
LAZY_CONSERVATIVE,
PARALLEL_CONSERVATIVE,
+ CONCURRENT_CONSERVATIVE,
PRECISE
};
@@ -695,6 +696,8 @@
bool IsConcurrentSweepingInProgress();
+ void FinalizeSweeping();
+
// Parallel marking support.
void MarkInParallel();
@@ -708,6 +711,8 @@
void RemoveDeadInvalidatedCode();
void ProcessInvalidatedCode(ObjectVisitor* visitor);
+ void ReleaseEvacuationCandidates();
+
void StartSweeperThreads();
#ifdef DEBUG
=======================================
--- /branches/bleeding_edge/src/spaces.cc Tue Feb 5 07:48:59 2013
+++ /branches/bleeding_edge/src/spaces.cc Thu Feb 21 05:12:12 2013
@@ -2578,6 +2578,7 @@
if (FLAG_concurrent_sweeping) {
if (collector->StealMemoryFromSweeperThreads(this) < size_in_bytes) {
collector->WaitUntilSweepingCompleted();
+ collector->FinalizeSweeping();
return true;
}
return false;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.