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

Unified Diff: src/sweeper-thread.h

Issue 11782028: Parallel and concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « src/spaces.cc ('k') | src/sweeper-thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sweeper-thread.h
diff --git a/src/platform-posix.h b/src/sweeper-thread.h
similarity index 58%
copy from src/platform-posix.h
copy to src/sweeper-thread.h
index 7a982ed2ef3080dad77860d6f46b356a9067bf3b..ba793c2043bd2724132bb7ab4dbaafcd55044468 100644
--- a/src/platform-posix.h
+++ b/src/sweeper-thread.h
@@ -25,15 +25,57 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_PLATFORM_POSIX_H_
-#define V8_PLATFORM_POSIX_H_
+#ifndef V8_SWEEPER_THREAD_H_
+#define V8_SWEEPER_THREAD_H_
+
+#include "atomicops.h"
+#include "flags.h"
+#include "platform.h"
+#include "v8utils.h"
+
+#include "spaces.h"
+
+#include "heap.h"
namespace v8 {
namespace internal {
-// Used by platform implementation files during OS::PostSetUp().
-void POSIXPostSetUp();
+class SweeperThread : public Thread {
+ public:
+ explicit SweeperThread(Isolate* isolate);
+
+ void Run();
+ void Stop();
+ 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_;
+ delete end_sweeping_semaphore_;
+ delete stop_semaphore_;
+ }
+
+ private:
+ Isolate* isolate_;
+ Heap* heap_;
+ MarkCompactCollector* collector_;
+ Semaphore* start_sweeping_semaphore_;
+ Semaphore* end_sweeping_semaphore_;
+ Semaphore* stop_semaphore_;
+ FreeList free_list_old_data_space_;
+ FreeList free_list_old_pointer_space_;
+ 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
-#endif // V8_PLATFORM_POSIX_H_
+#endif // V8_SWEEPER_THREAD_H_
« no previous file with comments | « src/spaces.cc ('k') | src/sweeper-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698