Move sweeping pending status field of concurrent sweepers to MarkCompactCollector.
BUG= Review URL: https://codereview.chromium.org/12261011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13661 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
5db57ed97c
commit
37d88cca4e
@ -66,6 +66,7 @@ MarkCompactCollector::MarkCompactCollector() : // NOLINT
|
||||
marking_parity_(ODD_MARKING_PARITY),
|
||||
compacting_(false),
|
||||
was_marked_incrementally_(false),
|
||||
sweeping_pending_(false),
|
||||
tracer_(NULL),
|
||||
migration_slots_buffer_(NULL),
|
||||
heap_(NULL),
|
||||
@ -527,7 +528,7 @@ void MarkCompactCollector::ClearMarkbits() {
|
||||
|
||||
|
||||
void MarkCompactCollector::StartSweeperThreads() {
|
||||
SweeperThread::set_sweeping_pending(true);
|
||||
sweeping_pending_ = true;
|
||||
for (int i = 0; i < FLAG_sweeper_threads; i++) {
|
||||
heap()->isolate()->sweeper_threads()[i]->StartSweeping();
|
||||
}
|
||||
@ -535,11 +536,11 @@ void MarkCompactCollector::StartSweeperThreads() {
|
||||
|
||||
|
||||
void MarkCompactCollector::WaitUntilSweepingCompleted() {
|
||||
if (SweeperThread::sweeping_pending()) {
|
||||
if (sweeping_pending_) {
|
||||
for (int i = 0; i < FLAG_sweeper_threads; i++) {
|
||||
heap()->isolate()->sweeper_threads()[i]->WaitForSweeperThread();
|
||||
}
|
||||
SweeperThread::set_sweeping_pending(false);
|
||||
sweeping_pending_ = false;
|
||||
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_DATA_SPACE));
|
||||
StealMemoryFromSweeperThreads(heap()->paged_space(OLD_POINTER_SPACE));
|
||||
heap()->FreeQueuedChunks();
|
||||
@ -563,7 +564,7 @@ bool MarkCompactCollector::AreSweeperThreadsActivated() {
|
||||
|
||||
|
||||
bool MarkCompactCollector::IsConcurrentSweepingInProgress() {
|
||||
return SweeperThread::sweeping_pending();
|
||||
return sweeping_pending_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -740,6 +740,9 @@ class MarkCompactCollector {
|
||||
|
||||
bool was_marked_incrementally_;
|
||||
|
||||
// True if concurrent or parallel sweeping is currently in progress.
|
||||
bool sweeping_pending_;
|
||||
|
||||
// A pointer to the current stack-allocated GC tracer object during a full
|
||||
// collection (NULL before and after).
|
||||
GCTracer* tracer_;
|
||||
|
@ -54,9 +54,6 @@ SweeperThread::SweeperThread(Isolate* isolate)
|
||||
}
|
||||
|
||||
|
||||
bool SweeperThread::sweeping_pending_ = false;
|
||||
|
||||
|
||||
void SweeperThread::Run() {
|
||||
Isolate::SetIsolateThreadLocals(isolate_, NULL);
|
||||
while (true) {
|
||||
@ -77,6 +74,7 @@ void SweeperThread::Run() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
intptr_t SweeperThread::StealMemory(PagedSpace* space) {
|
||||
intptr_t free_bytes = 0;
|
||||
if (space->identity() == OLD_POINTER_SPACE) {
|
||||
|
@ -50,11 +50,6 @@ class SweeperThread : public Thread {
|
||||
void WaitForSweeperThread();
|
||||
intptr_t StealMemory(PagedSpace* space);
|
||||
|
||||
static bool sweeping_pending() { return sweeping_pending_; }
|
||||
static void set_sweeping_pending(bool sweeping_pending) {
|
||||
sweeping_pending_ = sweeping_pending;
|
||||
}
|
||||
|
||||
~SweeperThread() {
|
||||
delete start_sweeping_semaphore_;
|
||||
delete end_sweeping_semaphore_;
|
||||
@ -73,7 +68,6 @@ class SweeperThread : public Thread {
|
||||
FreeList private_free_list_old_data_space_;
|
||||
FreeList private_free_list_old_pointer_space_;
|
||||
volatile AtomicWord stop_thread_;
|
||||
static bool sweeping_pending_;
|
||||
};
|
||||
|
||||
} } // namespace v8::internal
|
||||
|
Loading…
Reference in New Issue
Block a user