Revision: 13661
Author:   [email protected]
Date:     Wed Feb 13 07:21:08 2013
Log: Move sweeping pending status field of concurrent sweepers to MarkCompactCollector.

BUG=

Review URL: https://codereview.chromium.org/12261011
http://code.google.com/p/v8/source/detail?r=13661

Modified:
 /branches/bleeding_edge/src/mark-compact.cc
 /branches/bleeding_edge/src/mark-compact.h
 /branches/bleeding_edge/src/sweeper-thread.cc
 /branches/bleeding_edge/src/sweeper-thread.h

=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Wed Feb 13 04:46:06 2013
+++ /branches/bleeding_edge/src/mark-compact.cc Wed Feb 13 07:21:08 2013
@@ -66,6 +66,7 @@
       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::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::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::IsConcurrentSweepingInProgress() {
-  return SweeperThread::sweeping_pending();
+  return sweeping_pending_;
 }


=======================================
--- /branches/bleeding_edge/src/mark-compact.h  Tue Feb  5 07:48:59 2013
+++ /branches/bleeding_edge/src/mark-compact.h  Wed Feb 13 07:21:08 2013
@@ -740,6 +740,9 @@

   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_;
=======================================
--- /branches/bleeding_edge/src/sweeper-thread.cc       Wed Feb 13 05:19:38 2013
+++ /branches/bleeding_edge/src/sweeper-thread.cc       Wed Feb 13 07:21:08 2013
@@ -52,9 +52,6 @@
            heap_->paged_space(OLD_POINTER_SPACE)) {
   NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false));
 }
-
-
-bool SweeperThread::sweeping_pending_ = false;


 void SweeperThread::Run() {
@@ -76,6 +73,7 @@
     end_sweeping_semaphore_->Signal();
   }
 }
+

 intptr_t SweeperThread::StealMemory(PagedSpace* space) {
   intptr_t free_bytes = 0;
=======================================
--- /branches/bleeding_edge/src/sweeper-thread.h        Wed Jan 30 04:19:32 2013
+++ /branches/bleeding_edge/src/sweeper-thread.h        Wed Feb 13 07:21:08 2013
@@ -49,11 +49,6 @@
   void StartSweeping();
   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_;
@@ -73,7 +68,6 @@
   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

--
--
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.


Reply via email to