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

Unified Diff: src/isolate.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
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.h » ('j') | src/marking-thread.h » ('J')
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 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;
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.h » ('j') | src/marking-thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698