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

Unified Diff: src/isolate.cc

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/isolate.h ('k') | src/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index f0eb36d2ca3e3a12172e2869be3a894f139fe483..2f893abb358b6e15178cd5fce9e7381ff7fa4a13 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"
@@ -1699,6 +1700,7 @@ Isolate::Isolate()
#undef ISOLATE_INIT_ARRAY_EXECUTE
}
+
void Isolate::TearDown() {
TRACE_ISOLATE(tear_down);
@@ -1734,6 +1736,14 @@ 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();
+ delete sweeper_thread_[i];
+ }
+ delete[] sweeper_thread_;
+ }
+
if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop();
if (FLAG_hydrogen_stats) HStatistics::Instance()->Print();
@@ -2103,6 +2113,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;
}
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698