Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 8263b5d9d77b01e2769f36fc1e85d8ca8db7e902..1a1105386b7f9746929e6e50d98a50273b471ad2 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -608,6 +608,22 @@ void MarkCompactCollector::WaitUntilSweepingCompleted() { |
} |
+bool MarkCompactCollector::IsSweepingCompleted() { |
+ for (int i = 0; i < isolate()->num_sweeper_threads(); i++) { |
+ if (!isolate()->sweeper_threads()[i]->SweepingCompleted()) { |
+ return false; |
+ } |
+ } |
+ if (FLAG_job_based_sweeping) { |
+ if (!pending_sweeper_jobs_semaphore_.WaitFor(TimeDelta::FromSeconds(0))) { |
+ return false; |
+ } |
+ pending_sweeper_jobs_semaphore_.Signal(); |
+ } |
+ return true; |
+} |
+ |
+ |
void MarkCompactCollector::RefillFreeList(PagedSpace* space) { |
FreeList* free_list; |