tests compile but crash

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f05fd929
...@@ -87,8 +87,8 @@ class CcTest { ...@@ -87,8 +87,8 @@ class CcTest {
class ApiTestFuzzer: public v8::internal::Thread { class ApiTestFuzzer: public v8::internal::Thread {
public: public:
void CallTest(); void CallTest();
explicit ApiTestFuzzer(v8::internal::Isolate* isolate, int num) explicit ApiTestFuzzer(int num)
: Thread(isolate, "ApiTestFuzzer"), : Thread("ApiTestFuzzer"),
test_number_(num), test_number_(num),
gate_(v8::internal::OS::CreateSemaphore(0)), gate_(v8::internal::OS::CreateSemaphore(0)),
active_(true) { active_(true) {
......
...@@ -9342,8 +9342,7 @@ void ApiTestFuzzer::Setup(PartOfTest part) { ...@@ -9342,8 +9342,7 @@ void ApiTestFuzzer::Setup(PartOfTest part) {
int end = (count * (part + 1) / (LAST_PART + 1)) - 1; int end = (count * (part + 1) / (LAST_PART + 1)) - 1;
active_tests_ = tests_being_run_ = end - start + 1; active_tests_ = tests_being_run_ = end - start + 1;
for (int i = 0; i < tests_being_run_; i++) { for (int i = 0; i < tests_being_run_; i++) {
RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer( RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer(i + start);
i::Isolate::Current(), i + start);
} }
for (int i = 0; i < active_tests_; i++) { for (int i = 0; i < active_tests_; i++) {
RegisterThreadedTest::nth(i)->fuzzer_->Start(); RegisterThreadedTest::nth(i)->fuzzer_->Start();
...@@ -10459,7 +10458,7 @@ class RegExpInterruptTest { ...@@ -10459,7 +10458,7 @@ class RegExpInterruptTest {
gc_during_regexp_ = 0; gc_during_regexp_ = 0;
regexp_success_ = false; regexp_success_ = false;
gc_success_ = false; gc_success_ = false;
GCThread gc_thread(i::Isolate::Current(), this); GCThread gc_thread(this);
gc_thread.Start(); gc_thread.Start();
v8::Locker::StartPreemption(1); v8::Locker::StartPreemption(1);
...@@ -10479,8 +10478,8 @@ class RegExpInterruptTest { ...@@ -10479,8 +10478,8 @@ class RegExpInterruptTest {
class GCThread : public i::Thread { class GCThread : public i::Thread {
public: public:
explicit GCThread(i::Isolate* isolate, RegExpInterruptTest* test) GCThread(RegExpInterruptTest* test)
: Thread(isolate, "GCThread"), test_(test) {} : Thread("GCThread"), test_(test) {}
virtual void Run() { virtual void Run() {
test_->CollectGarbage(); test_->CollectGarbage();
} }
...@@ -10582,7 +10581,7 @@ class ApplyInterruptTest { ...@@ -10582,7 +10581,7 @@ class ApplyInterruptTest {
gc_during_apply_ = 0; gc_during_apply_ = 0;
apply_success_ = false; apply_success_ = false;
gc_success_ = false; gc_success_ = false;
GCThread gc_thread(i::Isolate::Current(), this); GCThread gc_thread(this);
gc_thread.Start(); gc_thread.Start();
v8::Locker::StartPreemption(1); v8::Locker::StartPreemption(1);
...@@ -10602,8 +10601,8 @@ class ApplyInterruptTest { ...@@ -10602,8 +10601,8 @@ class ApplyInterruptTest {
class GCThread : public i::Thread { class GCThread : public i::Thread {
public: public:
explicit GCThread(i::Isolate* isolate, ApplyInterruptTest* test) explicit GCThread(ApplyInterruptTest* test)
: Thread(isolate, "GCThread"), test_(test) {} : Thread("GCThread"), test_(test) {}
virtual void Run() { virtual void Run() {
test_->CollectGarbage(); test_->CollectGarbage();
} }
...@@ -10877,7 +10876,7 @@ class RegExpStringModificationTest { ...@@ -10877,7 +10876,7 @@ class RegExpStringModificationTest {
NONE, NONE,
i::kNonStrictMode)->ToObjectChecked(); i::kNonStrictMode)->ToObjectChecked();
MorphThread morph_thread(i::Isolate::Current(), this); MorphThread morph_thread(this);
morph_thread.Start(); morph_thread.Start();
v8::Locker::StartPreemption(1); v8::Locker::StartPreemption(1);
LongRunningRegExp(); LongRunningRegExp();
...@@ -10897,9 +10896,8 @@ class RegExpStringModificationTest { ...@@ -10897,9 +10896,8 @@ class RegExpStringModificationTest {
class MorphThread : public i::Thread { class MorphThread : public i::Thread {
public: public:
explicit MorphThread(i::Isolate* isolate, explicit MorphThread(RegExpStringModificationTest* test)
RegExpStringModificationTest* test) : Thread("MorphThread"), test_(test) {}
: Thread(isolate, "MorphThread"), test_(test) {}
virtual void Run() { virtual void Run() {
test_->MorphString(); test_->MorphString();
} }
...@@ -13716,8 +13714,8 @@ static int CalcFibonacci(v8::Isolate* isolate, int limit) { ...@@ -13716,8 +13714,8 @@ static int CalcFibonacci(v8::Isolate* isolate, int limit) {
class IsolateThread : public v8::internal::Thread { class IsolateThread : public v8::internal::Thread {
public: public:
explicit IsolateThread(v8::Isolate* isolate, int fib_limit) IsolateThread(v8::Isolate* isolate, int fib_limit)
: Thread(NULL, "IsolateThread"), : Thread("IsolateThread"),
isolate_(isolate), isolate_(isolate),
fib_limit_(fib_limit), fib_limit_(fib_limit),
result_(0) { } result_(0) { }
...@@ -13797,7 +13795,7 @@ class InitDefaultIsolateThread : public v8::internal::Thread { ...@@ -13797,7 +13795,7 @@ class InitDefaultIsolateThread : public v8::internal::Thread {
}; };
explicit InitDefaultIsolateThread(TestCase testCase) explicit InitDefaultIsolateThread(TestCase testCase)
: Thread(NULL, "InitDefaultIsolateThread"), : Thread("InitDefaultIsolateThread"),
testCase_(testCase), testCase_(testCase),
result_(false) { } result_(false) { }
......
...@@ -84,12 +84,11 @@ class ProducerThread: public i::Thread { ...@@ -84,12 +84,11 @@ class ProducerThread: public i::Thread {
public: public:
typedef SamplingCircularQueue::Cell Record; typedef SamplingCircularQueue::Cell Record;
ProducerThread(i::Isolate* isolate, ProducerThread(SamplingCircularQueue* scq,
SamplingCircularQueue* scq,
int records_per_chunk, int records_per_chunk,
Record value, Record value,
i::Semaphore* finished) i::Semaphore* finished)
: Thread(isolate, "producer"), : Thread("producer"),
scq_(scq), scq_(scq),
records_per_chunk_(records_per_chunk), records_per_chunk_(records_per_chunk),
value_(value), value_(value),
...@@ -133,10 +132,9 @@ TEST(SamplingCircularQueueMultithreading) { ...@@ -133,10 +132,9 @@ TEST(SamplingCircularQueueMultithreading) {
// Check that we are using non-reserved values. // Check that we are using non-reserved values.
CHECK_NE(SamplingCircularQueue::kClear, 1); CHECK_NE(SamplingCircularQueue::kClear, 1);
CHECK_NE(SamplingCircularQueue::kEnd, 1); CHECK_NE(SamplingCircularQueue::kEnd, 1);
i::Isolate* isolate = i::Isolate::Current(); ProducerThread producer1(&scq, kRecordsPerChunk, 1, semaphore);
ProducerThread producer1(isolate, &scq, kRecordsPerChunk, 1, semaphore); ProducerThread producer2(&scq, kRecordsPerChunk, 10, semaphore);
ProducerThread producer2(isolate, &scq, kRecordsPerChunk, 10, semaphore); ProducerThread producer3(&scq, kRecordsPerChunk, 20, semaphore);
ProducerThread producer3(isolate, &scq, kRecordsPerChunk, 20, semaphore);
CHECK_EQ(NULL, scq.StartDequeue()); CHECK_EQ(NULL, scq.StartDequeue());
producer1.Start(); producer1.Start();
......
...@@ -24,7 +24,7 @@ using i::TokenEnumerator; ...@@ -24,7 +24,7 @@ using i::TokenEnumerator;
TEST(StartStop) { TEST(StartStop) {
CpuProfilesCollection profiles; CpuProfilesCollection profiles;
ProfileGenerator generator(&profiles); ProfileGenerator generator(&profiles);
ProfilerEventsProcessor processor(i::Isolate::Current(), &generator); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
processor.Stop(); processor.Stop();
processor.Join(); processor.Join();
...@@ -85,7 +85,7 @@ TEST(CodeEvents) { ...@@ -85,7 +85,7 @@ TEST(CodeEvents) {
CpuProfilesCollection profiles; CpuProfilesCollection profiles;
profiles.StartProfiling("", 1); profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles); ProfileGenerator generator(&profiles);
ProfilerEventsProcessor processor(i::Isolate::Current(), &generator); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
// Enqueue code creation events. // Enqueue code creation events.
...@@ -146,7 +146,7 @@ TEST(TickEvents) { ...@@ -146,7 +146,7 @@ TEST(TickEvents) {
CpuProfilesCollection profiles; CpuProfilesCollection profiles;
profiles.StartProfiling("", 1); profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles); ProfileGenerator generator(&profiles);
ProfilerEventsProcessor processor(i::Isolate::Current(), &generator); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
...@@ -236,7 +236,7 @@ TEST(Issue1398) { ...@@ -236,7 +236,7 @@ TEST(Issue1398) {
CpuProfilesCollection profiles; CpuProfilesCollection profiles;
profiles.StartProfiling("", 1); profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles); ProfileGenerator generator(&profiles);
ProfilerEventsProcessor processor(i::Isolate::Current(), &generator); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
......
...@@ -4728,8 +4728,8 @@ Barriers message_queue_barriers; ...@@ -4728,8 +4728,8 @@ Barriers message_queue_barriers;
// placing JSON debugger commands in the queue. // placing JSON debugger commands in the queue.
class MessageQueueDebuggerThread : public v8::internal::Thread { class MessageQueueDebuggerThread : public v8::internal::Thread {
public: public:
explicit MessageQueueDebuggerThread(v8::internal::Isolate* isolate) MessageQueueDebuggerThread()
: Thread(isolate, "MessageQueueDebuggerThread") { } : Thread("MessageQueueDebuggerThread") { }
void Run(); void Run();
}; };
...@@ -4832,8 +4832,7 @@ void MessageQueueDebuggerThread::Run() { ...@@ -4832,8 +4832,7 @@ void MessageQueueDebuggerThread::Run() {
// This thread runs the v8 engine. // This thread runs the v8 engine.
TEST(MessageQueues) { TEST(MessageQueues) {
MessageQueueDebuggerThread message_queue_debugger_thread( MessageQueueDebuggerThread message_queue_debugger_thread;
i::Isolate::Current());
// Create a V8 environment // Create a V8 environment
v8::HandleScope scope; v8::HandleScope scope;
...@@ -4980,15 +4979,13 @@ Barriers threaded_debugging_barriers; ...@@ -4980,15 +4979,13 @@ Barriers threaded_debugging_barriers;
class V8Thread : public v8::internal::Thread { class V8Thread : public v8::internal::Thread {
public: public:
explicit V8Thread(v8::internal::Isolate* isolate) V8Thread() : Thread("V8Thread") { }
: Thread(isolate, "V8Thread") { }
void Run(); void Run();
}; };
class DebuggerThread : public v8::internal::Thread { class DebuggerThread : public v8::internal::Thread {
public: public:
explicit DebuggerThread(v8::internal::Isolate* isolate) DebuggerThread() : Thread("DebuggerThread") { }
: Thread(isolate, "DebuggerThread") { }
void Run(); void Run();
}; };
...@@ -5065,8 +5062,8 @@ void DebuggerThread::Run() { ...@@ -5065,8 +5062,8 @@ void DebuggerThread::Run() {
TEST(ThreadedDebugging) { TEST(ThreadedDebugging) {
DebuggerThread debugger_thread(i::Isolate::Current()); DebuggerThread debugger_thread;
V8Thread v8_thread(i::Isolate::Current()); V8Thread v8_thread;
// Create a V8 environment // Create a V8 environment
threaded_debugging_barriers.Initialize(); threaded_debugging_barriers.Initialize();
...@@ -5087,16 +5084,14 @@ TEST(ThreadedDebugging) { ...@@ -5087,16 +5084,14 @@ TEST(ThreadedDebugging) {
class BreakpointsV8Thread : public v8::internal::Thread { class BreakpointsV8Thread : public v8::internal::Thread {
public: public:
explicit BreakpointsV8Thread(v8::internal::Isolate* isolate) BreakpointsV8Thread() : Thread("BreakpointsV8Thread") { }
: Thread(isolate, "BreakpointsV8Thread") { }
void Run(); void Run();
}; };
class BreakpointsDebuggerThread : public v8::internal::Thread { class BreakpointsDebuggerThread : public v8::internal::Thread {
public: public:
explicit BreakpointsDebuggerThread(v8::internal::Isolate* isolate, explicit BreakpointsDebuggerThread(bool global_evaluate)
bool global_evaluate) : Thread("BreakpointsDebuggerThread"),
: Thread(isolate, "BreakpointsDebuggerThread"),
global_evaluate_(global_evaluate) {} global_evaluate_(global_evaluate) {}
void Run(); void Run();
...@@ -5273,9 +5268,8 @@ void BreakpointsDebuggerThread::Run() { ...@@ -5273,9 +5268,8 @@ void BreakpointsDebuggerThread::Run() {
void TestRecursiveBreakpointsGeneric(bool global_evaluate) { void TestRecursiveBreakpointsGeneric(bool global_evaluate) {
i::FLAG_debugger_auto_break = true; i::FLAG_debugger_auto_break = true;
BreakpointsDebuggerThread breakpoints_debugger_thread(i::Isolate::Current(), BreakpointsDebuggerThread breakpoints_debugger_thread(global_evaluate);
global_evaluate); BreakpointsV8Thread breakpoints_v8_thread;
BreakpointsV8Thread breakpoints_v8_thread(i::Isolate::Current());
// Create a V8 environment // Create a V8 environment
Barriers stack_allocated_breakpoints_barriers; Barriers stack_allocated_breakpoints_barriers;
...@@ -5657,15 +5651,13 @@ TEST(DebuggerClearMessageHandlerWhileActive) { ...@@ -5657,15 +5651,13 @@ TEST(DebuggerClearMessageHandlerWhileActive) {
class HostDispatchV8Thread : public v8::internal::Thread { class HostDispatchV8Thread : public v8::internal::Thread {
public: public:
explicit HostDispatchV8Thread(v8::internal::Isolate* isolate) HostDispatchV8Thread() : Thread("HostDispatchV8Thread") { }
: Thread(isolate, "HostDispatchV8Thread") { }
void Run(); void Run();
}; };
class HostDispatchDebuggerThread : public v8::internal::Thread { class HostDispatchDebuggerThread : public v8::internal::Thread {
public: public:
explicit HostDispatchDebuggerThread(v8::internal::Isolate* isolate) HostDispatchDebuggerThread() : Thread("HostDispatchDebuggerThread") { }
: Thread(isolate, "HostDispatchDebuggerThread") { }
void Run(); void Run();
}; };
...@@ -5737,9 +5729,8 @@ void HostDispatchDebuggerThread::Run() { ...@@ -5737,9 +5729,8 @@ void HostDispatchDebuggerThread::Run() {
TEST(DebuggerHostDispatch) { TEST(DebuggerHostDispatch) {
HostDispatchDebuggerThread host_dispatch_debugger_thread( HostDispatchDebuggerThread host_dispatch_debugger_thread;
i::Isolate::Current()); HostDispatchV8Thread host_dispatch_v8_thread;
HostDispatchV8Thread host_dispatch_v8_thread(i::Isolate::Current());
i::FLAG_debugger_auto_break = true; i::FLAG_debugger_auto_break = true;
// Create a V8 environment // Create a V8 environment
...@@ -5763,15 +5754,14 @@ TEST(DebuggerHostDispatch) { ...@@ -5763,15 +5754,14 @@ TEST(DebuggerHostDispatch) {
class DebugMessageDispatchV8Thread : public v8::internal::Thread { class DebugMessageDispatchV8Thread : public v8::internal::Thread {
public: public:
explicit DebugMessageDispatchV8Thread(v8::internal::Isolate* isolate) DebugMessageDispatchV8Thread() : Thread("DebugMessageDispatchV8Thread") { }
: Thread(isolate, "DebugMessageDispatchV8Thread") { }
void Run(); void Run();
}; };
class DebugMessageDispatchDebuggerThread : public v8::internal::Thread { class DebugMessageDispatchDebuggerThread : public v8::internal::Thread {
public: public:
explicit DebugMessageDispatchDebuggerThread(v8::internal::Isolate* isolate) DebugMessageDispatchDebuggerThread()
: Thread(isolate, "DebugMessageDispatchDebuggerThread") { } : Thread("DebugMessageDispatchDebuggerThread") { }
void Run(); void Run();
}; };
...@@ -5805,10 +5795,8 @@ void DebugMessageDispatchDebuggerThread::Run() { ...@@ -5805,10 +5795,8 @@ void DebugMessageDispatchDebuggerThread::Run() {
TEST(DebuggerDebugMessageDispatch) { TEST(DebuggerDebugMessageDispatch) {
DebugMessageDispatchDebuggerThread debug_message_dispatch_debugger_thread( DebugMessageDispatchDebuggerThread debug_message_dispatch_debugger_thread;
i::Isolate::Current()); DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread;
DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread(
i::Isolate::Current());
i::FLAG_debugger_auto_break = true; i::FLAG_debugger_auto_break = true;
...@@ -5873,8 +5861,8 @@ TEST(DebuggerAgent) { ...@@ -5873,8 +5861,8 @@ TEST(DebuggerAgent) {
class DebuggerAgentProtocolServerThread : public i::Thread { class DebuggerAgentProtocolServerThread : public i::Thread {
public: public:
explicit DebuggerAgentProtocolServerThread(i::Isolate* isolate, int port) explicit DebuggerAgentProtocolServerThread(int port)
: Thread(isolate, "DebuggerAgentProtocolServerThread"), : Thread("DebuggerAgentProtocolServerThread"),
port_(port), port_(port),
server_(NULL), server_(NULL),
client_(NULL), client_(NULL),
...@@ -5939,7 +5927,7 @@ TEST(DebuggerAgentProtocolOverflowHeader) { ...@@ -5939,7 +5927,7 @@ TEST(DebuggerAgentProtocolOverflowHeader) {
// Create a socket server to receive a debugger agent message. // Create a socket server to receive a debugger agent message.
DebuggerAgentProtocolServerThread* server = DebuggerAgentProtocolServerThread* server =
new DebuggerAgentProtocolServerThread(i::Isolate::Current(), kPort); new DebuggerAgentProtocolServerThread(kPort);
server->Start(); server->Start();
server->WaitForListening(); server->WaitForListening();
......
...@@ -64,7 +64,7 @@ class KangarooThread : public v8::internal::Thread { ...@@ -64,7 +64,7 @@ class KangarooThread : public v8::internal::Thread {
public: public:
KangarooThread(v8::Isolate* isolate, KangarooThread(v8::Isolate* isolate,
v8::Handle<v8::Context> context, int value) v8::Handle<v8::Context> context, int value)
: Thread(NULL, "KangarooThread"), : Thread("KangarooThread"),
isolate_(isolate), context_(context), value_(value) { isolate_(isolate), context_(context), value_(value) {
} }
...@@ -149,8 +149,8 @@ class JoinableThread { ...@@ -149,8 +149,8 @@ class JoinableThread {
private: private:
class ThreadWithSemaphore : public i::Thread { class ThreadWithSemaphore : public i::Thread {
public: public:
explicit ThreadWithSemaphore(JoinableThread* joinable_thread) ThreadWithSemaphore(JoinableThread* joinable_thread)
: Thread(NULL, joinable_thread->name_), : Thread(joinable_thread->name_),
joinable_thread_(joinable_thread) { joinable_thread_(joinable_thread) {
} }
......
...@@ -48,7 +48,7 @@ static void DoTest() { ...@@ -48,7 +48,7 @@ static void DoTest() {
class TestThread : public Thread { class TestThread : public Thread {
public: public:
TestThread() : Thread(NULL, "TestThread") {} TestThread() : Thread("TestThread") {}
virtual void Run() { virtual void Run() {
DoTest(); DoTest();
......
...@@ -10,8 +10,8 @@ using namespace ::v8::internal; ...@@ -10,8 +10,8 @@ using namespace ::v8::internal;
class SocketListenerThread : public Thread { class SocketListenerThread : public Thread {
public: public:
explicit SocketListenerThread(Isolate* isolate, int port, int data_size) SocketListenerThread(int port, int data_size)
: Thread(isolate, "SocketListenerThread"), : Thread("SocketListenerThread"),
port_(port), port_(port),
data_size_(data_size), data_size_(data_size),
server_(NULL), server_(NULL),
...@@ -92,8 +92,7 @@ static void SendAndReceive(int port, char *data, int len) { ...@@ -92,8 +92,7 @@ static void SendAndReceive(int port, char *data, int len) {
OS::SNPrintF(Vector<char>(port_str, kPortBuferLen), "%d", port); OS::SNPrintF(Vector<char>(port_str, kPortBuferLen), "%d", port);
// Create a socket listener. // Create a socket listener.
SocketListenerThread* listener = new SocketListenerThread(Isolate::Current(), SocketListenerThread* listener = new SocketListenerThread(port, len);
port, len);
listener->Start(); listener->Start();
listener->WaitForListening(); listener->WaitForListening();
......
...@@ -160,8 +160,7 @@ TEST(TerminateOnlyV8ThreadFromThreadItselfNoLoop) { ...@@ -160,8 +160,7 @@ TEST(TerminateOnlyV8ThreadFromThreadItselfNoLoop) {
class TerminatorThread : public v8::internal::Thread { class TerminatorThread : public v8::internal::Thread {
public: public:
explicit TerminatorThread(i::Isolate* isolate) TerminatorThread() : Thread("TerminatorThread") { }
: Thread(isolate, "TerminatorThread") { }
void Run() { void Run() {
semaphore->Wait(); semaphore->Wait();
CHECK(!v8::V8::IsExecutionTerminating()); CHECK(!v8::V8::IsExecutionTerminating());
...@@ -174,7 +173,7 @@ class TerminatorThread : public v8::internal::Thread { ...@@ -174,7 +173,7 @@ class TerminatorThread : public v8::internal::Thread {
// from the side by another thread. // from the side by another thread.
TEST(TerminateOnlyV8ThreadFromOtherThread) { TEST(TerminateOnlyV8ThreadFromOtherThread) {
semaphore = v8::internal::OS::CreateSemaphore(0); semaphore = v8::internal::OS::CreateSemaphore(0);
TerminatorThread thread(i::Isolate::Current()); TerminatorThread thread;
thread.Start(); thread.Start();
v8::HandleScope scope; v8::HandleScope scope;
...@@ -196,8 +195,7 @@ TEST(TerminateOnlyV8ThreadFromOtherThread) { ...@@ -196,8 +195,7 @@ TEST(TerminateOnlyV8ThreadFromOtherThread) {
class LoopingThread : public v8::internal::Thread { class LoopingThread : public v8::internal::Thread {
public: public:
explicit LoopingThread(i::Isolate* isolate) LoopingThread() : Thread("LoopingThread") { }
: Thread(isolate, "LoopingThread") { }
void Run() { void Run() {
v8::Locker locker; v8::Locker locker;
v8::HandleScope scope; v8::HandleScope scope;
...@@ -233,7 +231,7 @@ TEST(TerminateMultipleV8ThreadsDefaultIsolate) { ...@@ -233,7 +231,7 @@ TEST(TerminateMultipleV8ThreadsDefaultIsolate) {
const int kThreads = 2; const int kThreads = 2;
i::List<LoopingThread*> threads(kThreads); i::List<LoopingThread*> threads(kThreads);
for (int i = 0; i < kThreads; i++) { for (int i = 0; i < kThreads; i++) {
threads.Add(new LoopingThread(i::Isolate::Current())); threads.Add(new LoopingThread());
} }
for (int i = 0; i < kThreads; i++) { for (int i = 0; i < kThreads; i++) {
threads[i]->Start(); threads[i]->Start();
......
...@@ -65,7 +65,7 @@ static Turn turn = FILL_CACHE; ...@@ -65,7 +65,7 @@ static Turn turn = FILL_CACHE;
class ThreadA: public v8::internal::Thread { class ThreadA: public v8::internal::Thread {
public: public:
explicit ThreadA(i::Isolate* isolate) : Thread(isolate, "ThreadA") { } ThreadA() : Thread("ThreadA") { }
void Run() { void Run() {
v8::Locker locker; v8::Locker locker;
v8::HandleScope scope; v8::HandleScope scope;
...@@ -101,7 +101,7 @@ class ThreadA: public v8::internal::Thread { ...@@ -101,7 +101,7 @@ class ThreadA: public v8::internal::Thread {
class ThreadB: public v8::internal::Thread { class ThreadB: public v8::internal::Thread {
public: public:
explicit ThreadB(i::Isolate* isolate) : Thread(isolate, "ThreadB") { } ThreadB() : Thread("ThreadB") { }
void Run() { void Run() {
do { do {
{ {
...@@ -126,8 +126,8 @@ class ThreadB: public v8::internal::Thread { ...@@ -126,8 +126,8 @@ class ThreadB: public v8::internal::Thread {
TEST(JSFunctionResultCachesInTwoThreads) { TEST(JSFunctionResultCachesInTwoThreads) {
v8::V8::Initialize(); v8::V8::Initialize();
ThreadA threadA(i::Isolate::Current()); ThreadA threadA;
ThreadB threadB(i::Isolate::Current()); ThreadB threadB;
threadA.Start(); threadA.Start();
threadB.Start(); threadB.Start();
...@@ -144,7 +144,7 @@ class ThreadIdValidationThread : public v8::internal::Thread { ...@@ -144,7 +144,7 @@ class ThreadIdValidationThread : public v8::internal::Thread {
i::List<i::ThreadId>* refs, i::List<i::ThreadId>* refs,
unsigned int thread_no, unsigned int thread_no,
i::Semaphore* semaphore) i::Semaphore* semaphore)
: Thread(NULL, "ThreadRefValidationThread"), : Thread("ThreadRefValidationThread"),
refs_(refs), thread_no_(thread_no), thread_to_start_(thread_to_start), refs_(refs), thread_no_(thread_no), thread_to_start_(thread_to_start),
semaphore_(semaphore) { semaphore_(semaphore) {
} }
......
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