Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 60e3379e15a4d848aad2fed45fdadd58c14d7354..623b58f4984f656fafad4db8ec8a115a2585db7f 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -49,6 +49,7 @@ |
#include "simulator.h" |
#include "spaces.h" |
#include "stub-cache.h" |
+#include "sweeper-thread.h" |
#include "version.h" |
#include "vm-state-inl.h" |
@@ -1692,6 +1693,7 @@ Isolate::Isolate() |
#undef ISOLATE_INIT_ARRAY_EXECUTE |
} |
+ |
void Isolate::TearDown() { |
TRACE_ISOLATE(tear_down); |
@@ -1727,6 +1729,17 @@ void Isolate::Deinit() { |
if (state_ == INITIALIZED) { |
TRACE_ISOLATE(deinit); |
+ if (FLAG_concurrent_sweeping || FLAG_parallel_sweeping) { |
+ for (int i = 0; i < FLAG_sweeper_threads; i++) { |
+ sweeper_thread_[i]->Stop(); |
+ } |
+ |
+ for (int i = 0; i < FLAG_sweeper_threads; i++) { |
Michael Starzinger
2013/01/30 11:01:19
Can we merge the two for-loops, I think that's eas
Hannes Payer (out of office)
2013/01/30 12:07:32
Done.
|
+ delete sweeper_thread_[i]; |
+ } |
+ delete[] sweeper_thread_; |
+ } |
+ |
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); |
if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
@@ -2089,6 +2102,17 @@ bool Isolate::Init(Deserializer* des) { |
} |
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); |
+ |
+ if (FLAG_parallel_sweeping || FLAG_concurrent_sweeping) { |
+ if (FLAG_sweeper_threads < 1) { |
+ FLAG_sweeper_threads = 1; |
+ } |
+ sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; |
+ for (int i = 0; i < FLAG_sweeper_threads; i++) { |
+ sweeper_thread_[i] = new SweeperThread(this); |
+ sweeper_thread_[i]->Start(); |
+ } |
+ } |
return true; |
} |