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

Unified Diff: src/mark-compact.cc

Issue 12047044: Added parallel marking threads. (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
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 4dc4a95c8de2ab9b830c365a4b498fffb06e7d38..bdd4785e3e729368ab1c6bf297e48457f9b5c6b4 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -37,6 +37,7 @@
#include "ic-inl.h"
#include "incremental-marking.h"
#include "mark-compact.h"
+#include "marking-thread.h"
#include "objects-visiting.h"
#include "objects-visiting-inl.h"
#include "stub-cache.h"
@@ -540,6 +541,20 @@ bool MarkCompactCollector::AreSweeperThreadsActivated() {
}
+void MarkCompactCollector::MarkInParallel() {
+ for (int i = 0; i < FLAG_marking_threads; i++) {
+ heap()->isolate()->marking_threads()[i]->StartMarking();
+ }
+}
+
+
+void MarkCompactCollector::WaitUntilMarkingCompleted() {
+ for (int i = 0; i < FLAG_marking_threads; i++) {
+ heap()->isolate()->marking_threads()[i]->WaitForMarkingThread();
+ }
+}
+
+
bool Marking::TransferMark(Address old_start, Address new_start) {
// This is only used when resizing an object.
ASSERT(MemoryChunk::FromAddress(old_start) ==
« no previous file with comments | « src/mark-compact.h ('k') | src/marking-thread.h » ('j') | src/marking-thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698