Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index f1928cfed8a8fd260bc6cb0a81114931f4c80f86..d70e19e0ebcdfab65ceb688334da39f7255f901a 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -40,6 +40,7 @@ |
#include "isolate.h" |
#include "lithium-allocator.h" |
#include "log.h" |
+#include "marking-thread.h" |
#include "messages.h" |
#include "platform.h" |
#include "regexp-stack.h" |
@@ -1653,6 +1654,7 @@ Isolate::Isolate() |
context_exit_happened_(false), |
deferred_handles_head_(NULL), |
optimizing_compiler_thread_(this), |
+ marking_thread_(NULL), |
sweeper_thread_(NULL) { |
TRACE_ISOLATE(constructor); |
@@ -1745,6 +1747,14 @@ void Isolate::Deinit() { |
delete[] sweeper_thread_; |
} |
+ if (FLAG_parallel_marking) { |
+ for (int i = 0; i < FLAG_marking_threads; i++) { |
+ marking_thread_[i]->Stop(); |
+ delete marking_thread_[i]; |
+ } |
+ delete[] marking_thread_; |
+ } |
+ |
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); |
if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
@@ -2115,6 +2125,17 @@ bool Isolate::Init(Deserializer* des) { |
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); |
+ if (FLAG_parallel_marking) { |
+ if (FLAG_marking_threads < 1) { |
+ FLAG_marking_threads = 1; |
+ } |
+ marking_thread_ = new MarkingThread*[FLAG_marking_threads]; |
+ for (int i = 0; i < FLAG_marking_threads; i++) { |
+ marking_thread_[i] = new MarkingThread(this); |
+ marking_thread_[i]->Start(); |
+ } |
+ } |
+ |
if (FLAG_parallel_sweeping || FLAG_concurrent_sweeping) { |
if (FLAG_sweeper_threads < 1) { |
FLAG_sweeper_threads = 1; |