Commit 02b160f3 authored by jochen@chromium.org's avatar jochen@chromium.org

Remove parallel marking support.

The framework isn't used, and won't be used in the near future

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/25260003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17014 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f1fe1f95
......@@ -530,8 +530,6 @@ DEFINE_bool(parallel_sweeping, true, "enable parallel sweeping")
DEFINE_bool(concurrent_sweeping, false, "enable concurrent sweeping")
DEFINE_int(sweeper_threads, 0,
"number of parallel and concurrent sweeping threads")
DEFINE_bool(parallel_marking, false, "enable parallel marking")
DEFINE_int(marking_threads, 0, "number of parallel marking threads")
#ifdef VERIFY_HEAP
DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
#endif
......
......@@ -42,7 +42,6 @@
#include "isolate-inl.h"
#include "lithium-allocator.h"
#include "log.h"
#include "marking-thread.h"
#include "messages.h"
#include "platform.h"
#include "regexp-stack.h"
......@@ -147,8 +146,6 @@ int SystemThreadManager::NumberOfParallelSystemThreads(
return number_of_threads;
} else if (type == CONCURRENT_SWEEPING) {
return number_of_threads - 1;
} else if (type == PARALLEL_MARKING) {
return number_of_threads;
}
return 1;
}
......@@ -1800,7 +1797,6 @@ Isolate::Isolate()
function_entry_hook_(NULL),
deferred_handles_head_(NULL),
optimizing_compiler_thread_(NULL),
marking_thread_(NULL),
sweeper_thread_(NULL),
stress_deopt_count_(0) {
id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1);
......@@ -1907,14 +1903,6 @@ void Isolate::Deinit() {
delete[] sweeper_thread_;
}
if (FLAG_marking_threads > 0) {
for (int i = 0; i < FLAG_marking_threads; i++) {
marking_thread_[i]->Stop();
delete marking_thread_[i];
}
delete[] marking_thread_;
}
if (FLAG_hydrogen_stats) GetHStatistics()->Print();
if (FLAG_print_deopt_stress) {
......@@ -2348,14 +2336,6 @@ bool Isolate::Init(Deserializer* des) {
FastNewClosureStub::InstallDescriptors(this);
}
if (FLAG_marking_threads > 0) {
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_sweeper_threads > 0) {
sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads];
for (int i = 0; i < FLAG_sweeper_threads; i++) {
......
......@@ -75,7 +75,6 @@ class HTracer;
class InlineRuntimeFunctionsTable;
class NoAllocationStringAllocator;
class InnerPointerToCodeCache;
class MarkingThread;
class PreallocatedMemoryThread;
class RandomNumberGenerator;
class RegExpStack;
......@@ -308,7 +307,6 @@ class SystemThreadManager {
enum ParallelSystemComponent {
PARALLEL_SWEEPING,
CONCURRENT_SWEEPING,
PARALLEL_MARKING,
PARALLEL_RECOMPILATION
};
......@@ -1107,10 +1105,6 @@ class Isolate {
// TODO(svenpanne) This method is on death row...
static v8::Isolate* GetDefaultIsolateForLocking();
MarkingThread** marking_threads() {
return marking_thread_;
}
SweeperThread** sweeper_threads() {
return sweeper_thread_;
}
......@@ -1362,7 +1356,6 @@ class Isolate {
DeferredHandles* deferred_handles_head_;
OptimizingCompilerThread* optimizing_compiler_thread_;
MarkingThread** marking_thread_;
SweeperThread** sweeper_thread_;
// Counts deopt points if deopt_every_n_times is enabled.
......@@ -1371,7 +1364,6 @@ class Isolate {
friend class ExecutionAccess;
friend class HandleScopeImplementer;
friend class IsolateInitializer;
friend class MarkingThread;
friend class OptimizingCompilerThread;
friend class SweeperThread;
friend class ThreadManager;
......
......@@ -38,7 +38,6 @@
#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"
......@@ -601,20 +600,6 @@ bool MarkCompactCollector::IsConcurrentSweepingInProgress() {
}
void MarkCompactCollector::MarkInParallel() {
for (int i = 0; i < FLAG_marking_threads; i++) {
isolate()->marking_threads()[i]->StartMarking();
}
}
void MarkCompactCollector::WaitUntilMarkingCompleted() {
for (int i = 0; i < FLAG_marking_threads; i++) {
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) ==
......
......@@ -735,11 +735,6 @@ class MarkCompactCollector {
return sequential_sweeping_;
}
// Parallel marking support.
void MarkInParallel();
void WaitUntilMarkingCompleted();
private:
MarkCompactCollector();
~MarkCompactCollector();
......
// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "marking-thread.h"
#include "v8.h"
#include "isolate.h"
#include "v8threads.h"
namespace v8 {
namespace internal {
MarkingThread::MarkingThread(Isolate* isolate)
: Thread("MarkingThread"),
isolate_(isolate),
heap_(isolate->heap()),
start_marking_semaphore_(0),
end_marking_semaphore_(0),
stop_semaphore_(0) {
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false));
id_ = NoBarrier_AtomicIncrement(&id_counter_, 1);
}
Atomic32 MarkingThread::id_counter_ = -1;
void MarkingThread::Run() {
Isolate::SetIsolateThreadLocals(isolate_, NULL);
DisallowHeapAllocation no_allocation;
DisallowHandleAllocation no_handles;
DisallowHandleDereference no_deref;
while (true) {
start_marking_semaphore_.Wait();
if (Acquire_Load(&stop_thread_)) {
stop_semaphore_.Signal();
return;
}
end_marking_semaphore_.Signal();
}
}
void MarkingThread::Stop() {
Release_Store(&stop_thread_, static_cast<AtomicWord>(true));
start_marking_semaphore_.Signal();
stop_semaphore_.Wait();
Join();
}
void MarkingThread::StartMarking() {
start_marking_semaphore_.Signal();
}
void MarkingThread::WaitForMarkingThread() {
end_marking_semaphore_.Wait();
}
} } // namespace v8::internal
// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_MARKING_THREAD_H_
#define V8_MARKING_THREAD_H_
#include "atomicops.h"
#include "flags.h"
#include "platform.h"
#include "v8utils.h"
#include "spaces.h"
#include "heap.h"
namespace v8 {
namespace internal {
class MarkingThread : public Thread {
public:
explicit MarkingThread(Isolate* isolate);
~MarkingThread() {}
void Run();
void Stop();
void StartMarking();
void WaitForMarkingThread();
private:
Isolate* isolate_;
Heap* heap_;
Semaphore start_marking_semaphore_;
Semaphore end_marking_semaphore_;
Semaphore stop_semaphore_;
volatile AtomicWord stop_thread_;
int id_;
static Atomic32 id_counter_;
};
} } // namespace v8::internal
#endif // V8_MARKING_THREAD_H_
......@@ -227,19 +227,6 @@ void V8::InitializeOncePerProcessImpl() {
FLAG_sweeper_threads = 0;
}
if (FLAG_parallel_marking) {
if (FLAG_marking_threads <= 0) {
FLAG_marking_threads = SystemThreadManager::
NumberOfParallelSystemThreads(
SystemThreadManager::PARALLEL_MARKING);
}
if (FLAG_marking_threads == 0) {
FLAG_parallel_marking = false;
}
} else {
FLAG_marking_threads = 0;
}
if (FLAG_concurrent_recompilation &&
SystemThreadManager::NumberOfParallelSystemThreads(
SystemThreadManager::PARALLEL_RECOMPILATION) == 0) {
......
......@@ -414,8 +414,6 @@
'../../src/macro-assembler.h',
'../../src/mark-compact.cc',
'../../src/mark-compact.h',
'../../src/marking-thread.h',
'../../src/marking-thread.cc',
'../../src/messages.cc',
'../../src/messages.h',
'../../src/natives.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment