Revision: 8257
Author: [email protected]
Date: Fri Jun 10 02:42:08 2011
Log: Revert accidental r8254..r8256
http://code.google.com/p/v8/source/detail?r=8257
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/samples/shell.cc
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/cpu-profiler.cc
/branches/bleeding_edge/src/cpu-profiler.h
/branches/bleeding_edge/src/debug-agent.cc
/branches/bleeding_edge/src/debug-agent.h
/branches/bleeding_edge/src/debug.cc
/branches/bleeding_edge/src/isolate.cc
/branches/bleeding_edge/src/log.cc
/branches/bleeding_edge/src/platform-linux.cc
/branches/bleeding_edge/src/platform.h
/branches/bleeding_edge/src/v8threads.cc
/branches/bleeding_edge/src/v8threads.h
/branches/bleeding_edge/test/cctest/cctest.h
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/cctest/test-circular-queue.cc
/branches/bleeding_edge/test/cctest/test-cpu-profiler.cc
/branches/bleeding_edge/test/cctest/test-debug.cc
/branches/bleeding_edge/test/cctest/test-lockers.cc
/branches/bleeding_edge/test/cctest/test-platform-tls.cc
/branches/bleeding_edge/test/cctest/test-sockets.cc
/branches/bleeding_edge/test/cctest/test-thread-termination.cc
/branches/bleeding_edge/test/cctest/test-threads.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Fri Jun 10 02:36:35 2011
+++ /branches/bleeding_edge/include/v8.h Fri Jun 10 02:42:08 2011
@@ -3099,7 +3099,7 @@
* still JavaScript frames on the stack and the termination
* exception is still active.
*/
- static bool IsExecutionTerminating(Isolate* isolate = NULL);
+ static bool IsExecutionTerminating();
/**
* Releases any resources used by v8 and stops any utility threads
=======================================
--- /branches/bleeding_edge/samples/shell.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/samples/shell.cc Fri Jun 10 02:42:08 2011
@@ -170,7 +170,7 @@
class IsolateThread : public v8::internal::Thread {
public:
explicit IsolateThread(SourceGroup* group)
- : v8::internal::Thread(GetThreadOptions()), group_(group) {}
+ : v8::internal::Thread(NULL, GetThreadOptions()), group_(group) {}
virtual void Run() {
group_->ExecuteInThread();
=======================================
--- /branches/bleeding_edge/src/api.cc Fri Jun 10 02:36:35 2011
+++ /branches/bleeding_edge/src/api.cc Fri Jun 10 02:42:08 2011
@@ -4902,10 +4902,9 @@
}
-bool V8::IsExecutionTerminating(Isolate* isolate) {
- i::Isolate* i_isolate = isolate != NULL ?
- reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current();
- return IsExecutionTerminatingCheck(i_isolate);
+bool V8::IsExecutionTerminating() {
+ i::Isolate* isolate = i::Isolate::Current();
+ return IsExecutionTerminatingCheck(isolate);
}
=======================================
--- /branches/bleeding_edge/src/cpu-profiler.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/cpu-profiler.cc Fri Jun 10 02:42:08 2011
@@ -46,8 +46,9 @@
static const int kTickSamplesBufferChunksCount = 16;
-ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator*
generator)
- : Thread("v8:ProfEvntProc"),
+ProfilerEventsProcessor::ProfilerEventsProcessor(Isolate* isolate,
+ ProfileGenerator*
generator)
+ : Thread(isolate, "v8:ProfEvntProc"),
generator_(generator),
running_(true),
ticks_buffer_(sizeof(TickSampleEventRecord),
@@ -506,7 +507,7 @@
saved_logging_nesting_ = isolate->logger()->logging_nesting_;
isolate->logger()->logging_nesting_ = 0;
generator_ = new ProfileGenerator(profiles_);
- processor_ = new ProfilerEventsProcessor(generator_);
+ processor_ = new ProfilerEventsProcessor(isolate, generator_);
NoBarrier_Store(&is_profiling_, true);
processor_->Start();
// Enumerate stuff we already have in the heap.
=======================================
--- /branches/bleeding_edge/src/cpu-profiler.h Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/cpu-profiler.h Fri Jun 10 02:42:08 2011
@@ -134,7 +134,8 @@
// methods called by event producers: VM and stack sampler threads.
class ProfilerEventsProcessor : public Thread {
public:
- explicit ProfilerEventsProcessor(ProfileGenerator* generator);
+ ProfilerEventsProcessor(Isolate* isolate,
+ ProfileGenerator* generator);
virtual ~ProfilerEventsProcessor() {}
// Thread control.
=======================================
--- /branches/bleeding_edge/src/debug-agent.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/debug-agent.cc Fri Jun 10 02:42:08 2011
@@ -116,7 +116,7 @@
}
// Create a new session and hook up the debug message handler.
- session_ = new DebuggerAgentSession(this, client);
+ session_ = new DebuggerAgentSession(isolate(), this, client);
v8::Debug::SetMessageHandler2(DebuggerAgentMessageHandler);
session_->Start();
}
=======================================
--- /branches/bleeding_edge/src/debug-agent.h Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/debug-agent.h Fri Jun 10 02:42:08 2011
@@ -43,8 +43,8 @@
// handles connection from a remote debugger.
class DebuggerAgent: public Thread {
public:
- DebuggerAgent(const char* name, int port)
- : Thread(name),
+ DebuggerAgent(Isolate* isolate, const char* name, int port)
+ : Thread(isolate, name),
name_(StrDup(name)), port_(port),
server_(OS::CreateSocket()), terminate_(false),
session_access_(OS::CreateMutex()), session_(NULL),
@@ -88,8 +88,8 @@
// debugger and sends debugger events/responses to the remote debugger.
class DebuggerAgentSession: public Thread {
public:
- DebuggerAgentSession(DebuggerAgent* agent, Socket* client)
- : Thread("v8:DbgAgntSessn"),
+ DebuggerAgentSession(Isolate* isolate, DebuggerAgent* agent, Socket*
client)
+ : Thread(isolate, "v8:DbgAgntSessn"),
agent_(agent), client_(client) {}
void DebuggerMessage(Vector<uint16_t> message);
=======================================
--- /branches/bleeding_edge/src/debug.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/debug.cc Fri Jun 10 02:42:08 2011
@@ -2820,7 +2820,7 @@
if (Socket::Setup()) {
if (agent_ == NULL) {
- agent_ = new DebuggerAgent(name, port);
+ agent_ = new DebuggerAgent(isolate_, name, port);
agent_->Start();
}
return true;
@@ -3122,7 +3122,7 @@
MessageDispatchHelperThread::MessageDispatchHelperThread(Isolate* isolate)
- : Thread("v8:MsgDispHelpr"),
+ : Thread(isolate, "v8:MsgDispHelpr"),
sem_(OS::CreateSemaphore(0)), mutex_(OS::CreateMutex()),
already_signalled_(false) {
}
=======================================
--- /branches/bleeding_edge/src/isolate.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/isolate.cc Fri Jun 10 02:42:08 2011
@@ -190,8 +190,8 @@
private:
- PreallocatedMemoryThread()
- : Thread("v8:PreallocMem"),
+ explicit PreallocatedMemoryThread(Isolate* isolate)
+ : Thread(isolate, "v8:PreallocMem"),
keep_running_(true),
wait_for_ever_semaphore_(OS::CreateSemaphore(0)),
data_ready_semaphore_(OS::CreateSemaphore(0)),
@@ -219,7 +219,7 @@
void Isolate::PreallocatedMemoryThreadStart() {
if (preallocated_memory_thread_ != NULL) return;
- preallocated_memory_thread_ = new PreallocatedMemoryThread();
+ preallocated_memory_thread_ = new PreallocatedMemoryThread(this);
preallocated_memory_thread_->Start();
}
=======================================
--- /branches/bleeding_edge/src/log.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/log.cc Fri Jun 10 02:42:08 2011
@@ -83,7 +83,7 @@
//
class Profiler: public Thread {
public:
- Profiler();
+ explicit Profiler(Isolate* isolate);
void Engage();
void Disengage();
@@ -270,8 +270,8 @@
//
// Profiler implementation.
//
-Profiler::Profiler()
- : Thread("v8:Profiler"),
+Profiler::Profiler(Isolate* isolate)
+ : Thread(isolate, "v8:Profiler"),
head_(0),
tail_(0),
overflow_(false),
@@ -1858,7 +1858,7 @@
}
if (FLAG_prof) {
- profiler_ = new Profiler();
+ profiler_ = new Profiler(isolate);
if (!FLAG_prof_auto) {
profiler_->pause();
} else {
=======================================
--- /branches/bleeding_edge/src/platform-linux.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/platform-linux.cc Fri Jun 10 02:42:08 2011
@@ -653,15 +653,17 @@
pthread_t thread_; // Thread handle for pthread.
};
-Thread::Thread(const Options& options)
+Thread::Thread(Isolate* isolate, const Options& options)
: data_(new PlatformData()),
+ isolate_(isolate),
stack_size_(options.stack_size) {
set_name(options.name);
}
-Thread::Thread(const char* name)
+Thread::Thread(Isolate* isolate, const char* name)
: data_(new PlatformData()),
+ isolate_(isolate),
stack_size_(0) {
set_name(name);
}
@@ -682,6 +684,7 @@
0, 0, 0);
thread->data()->thread_ = pthread_self();
ASSERT(thread->data()->thread_ != kNoThread);
+ Thread::SetThreadLocal(Isolate::isolate_key(), thread->isolate());
thread->Run();
return NULL;
}
@@ -971,7 +974,7 @@
};
explicit SignalSender(int interval)
- : Thread("SignalSender"),
+ : Thread(NULL, "SignalSender"),
vm_tgid_(getpid()),
interval_(interval) {}
=======================================
--- /branches/bleeding_edge/src/platform.h Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/platform.h Fri Jun 10 02:42:08 2011
@@ -384,9 +384,9 @@
int stack_size;
};
- // Create new thread.
- explicit Thread(const Options& options);
- explicit Thread(const char* name);
+ // Create new thread (with a value for storing in the TLS isolate field).
+ Thread(Isolate* isolate, const Options& options);
+ Thread(Isolate* isolate, const char* name);
virtual ~Thread();
// Start new thread by calling the Run() method in the new thread.
@@ -433,6 +433,7 @@
// A hint to the scheduler to let another thread run.
static void YieldCPU();
+ Isolate* isolate() const { return isolate_; }
// The thread name length is limited to 16 based on Linux's
implementation of
// prctl().
@@ -446,6 +447,7 @@
PlatformData* data_;
+ Isolate* isolate_;
char name_[kMaxThreadNameLength];
int stack_size_;
=======================================
--- /branches/bleeding_edge/src/v8threads.cc Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/v8threads.cc Fri Jun 10 02:42:08 2011
@@ -401,10 +401,9 @@
ContextSwitcher::ContextSwitcher(Isolate* isolate, int every_n_ms)
- : Thread("v8:CtxtSwitcher"),
+ : Thread(isolate, "v8:CtxtSwitcher"),
keep_going_(true),
- sleep_ms_(every_n_ms),
- isolate_(isolate) {
+ sleep_ms_(every_n_ms) {
}
=======================================
--- /branches/bleeding_edge/src/v8threads.h Fri Jun 10 02:35:31 2011
+++ /branches/bleeding_edge/src/v8threads.h Fri Jun 10 02:42:08 2011
@@ -150,17 +150,14 @@
// Preempted thread needs to call back to the ContextSwitcher to
acknowledge
// the handling of a preemption request.
static void PreemptionReceived();
-
+
private:
- ContextSwitcher(Isolate* isolate, int every_n_ms);
-
- Isolate* isolate() const { return isolate_; }
+ explicit ContextSwitcher(Isolate* isolate, int every_n_ms);
void Run();
bool keep_going_;
int sleep_ms_;
- Isolate* isolate_;
};
} } // namespace v8::internal
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.h Fri Jun 10 02:36:18 2011
+++ /branches/bleeding_edge/test/cctest/cctest.h Fri Jun 10 02:42:08 2011
@@ -87,8 +87,8 @@
class ApiTestFuzzer: public v8::internal::Thread {
public:
void CallTest();
- explicit ApiTestFuzzer(int num)
- : Thread("ApiTestFuzzer"),
+ explicit ApiTestFuzzer(v8::internal::Isolate* isolate, int num)
+ : Thread(isolate, "ApiTestFuzzer"),
test_number_(num),
gate_(v8::internal::OS::CreateSemaphore(0)),
active_(true) {
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Fri Jun 10 02:36:18 2011
+++ /branches/bleeding_edge/test/cctest/test-api.cc Fri Jun 10 02:42:08 2011
@@ -9342,7 +9342,8 @@
int end = (count * (part + 1) / (LAST_PART + 1)) - 1;
active_tests_ = tests_being_run_ = end - start + 1;
for (int i = 0; i < tests_being_run_; i++) {
- RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer(i + start);
+ RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer(
+ i::Isolate::Current(), i + start);
}
for (int i = 0; i < active_tests_; i++) {
RegisterThreadedTest::nth(i)->fuzzer_->Start();
@@ -10458,7 +10459,7 @@
gc_during_regexp_ = 0;
regexp_success_ = false;
gc_success_ = false;
- GCThread gc_thread(this);
+ GCThread gc_thread(i::Isolate::Current(), this);
gc_thread.Start();
v8::Locker::StartPreemption(1);
@@ -10478,8 +10479,8 @@
class GCThread : public i::Thread {
public:
- GCThread(RegExpInterruptTest* test)
- : Thread("GCThread"), test_(test) {}
+ explicit GCThread(i::Isolate* isolate, RegExpInterruptTest* test)
+ : Thread(isolate, "GCThread"), test_(test) {}
virtual void Run() {
test_->CollectGarbage();
}
@@ -10581,7 +10582,7 @@
gc_during_apply_ = 0;
apply_success_ = false;
gc_success_ = false;
- GCThread gc_thread(this);
+ GCThread gc_thread(i::Isolate::Current(), this);
gc_thread.Start();
v8::Locker::StartPreemption(1);
@@ -10601,8 +10602,8 @@
class GCThread : public i::Thread {
public:
- explicit GCThread(ApplyInterruptTest* test)
- : Thread("GCThread"), test_(test) {}
+ explicit GCThread(i::Isolate* isolate, ApplyInterruptTest* test)
+ : Thread(isolate, "GCThread"), test_(test) {}
virtual void Run() {
test_->CollectGarbage();
}
@@ -10876,7 +10877,7 @@
NONE,
i::kNonStrictMode)->ToObjectChecked();
- MorphThread morph_thread(this);
+ MorphThread morph_thread(i::Isolate::Current(), this);
morph_thread.Start();
v8::Locker::StartPreemption(1);
LongRunningRegExp();
@@ -10896,8 +10897,9 @@
class MorphThread : public i::Thread {
public:
- explicit MorphThread(RegExpStringModificationTest* test)
- : Thread("MorphThread"), test_(test) {}
+ explicit MorphThread(i::Isolate* isolate,
+ RegExpStringModificationTest* test)
+ : Thread(isolate, "MorphThread"), test_(test) {}
virtual void Run() {
test_->MorphString();
}
@@ -13714,8 +13716,8 @@
class IsolateThread : public v8::internal::Thread {
public:
- IsolateThread(v8::Isolate* isolate, int fib_limit)
- : Thread("IsolateThread"),
+ explicit IsolateThread(v8::Isolate* isolate, int fib_limit)
+ : Thread(NULL, "IsolateThread"),
isolate_(isolate),
fib_limit_(fib_limit),
result_(0) { }
@@ -13795,7 +13797,7 @@
};
explicit InitDefaultIsolateThread(TestCase testCase)
- : Thread("InitDefaultIsolateThread"),
+ : Thread(NULL, "InitDefaultIsolateThread"),
testCase_(testCase),
result_(false) { }
=======================================
--- /branches/bleeding_edge/test/cctest/test-circular-queue.cc Fri Jun 10
02:36:18 2011
+++ /branches/bleeding_edge/test/cctest/test-circular-queue.cc Fri Jun 10
02:42:08 2011
@@ -84,11 +84,12 @@
public:
typedef SamplingCircularQueue::Cell Record;
- ProducerThread(SamplingCircularQueue* scq,
+ ProducerThread(i::Isolate* isolate,
+ SamplingCircularQueue* scq,
int records_per_chunk,
Record value,
i::Semaphore* finished)
- : Thread("producer"),
+ : Thread(isolate, "producer"),
scq_(scq),
records_per_chunk_(records_per_chunk),
value_(value),
@@ -132,9 +133,10 @@
// Check that we are using non-reserved values.
CHECK_NE(SamplingCircularQueue::kClear, 1);
CHECK_NE(SamplingCircularQueue::kEnd, 1);
- ProducerThread producer1(&scq, kRecordsPerChunk, 1, semaphore);
- ProducerThread producer2(&scq, kRecordsPerChunk, 10, semaphore);
- ProducerThread producer3(&scq, kRecordsPerChunk, 20, semaphore);
+ i::Isolate* isolate = i::Isolate::Current();
+ ProducerThread producer1(isolate, &scq, kRecordsPerChunk, 1, semaphore);
+ ProducerThread producer2(isolate, &scq, kRecordsPerChunk, 10, semaphore);
+ ProducerThread producer3(isolate, &scq, kRecordsPerChunk, 20, semaphore);
CHECK_EQ(NULL, scq.StartDequeue());
producer1.Start();
=======================================
--- /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Fri Jun 10
02:36:18 2011
+++ /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Fri Jun 10
02:42:08 2011
@@ -24,7 +24,7 @@
TEST(StartStop) {
CpuProfilesCollection profiles;
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(i::Isolate::Current(), &generator);
processor.Start();
processor.Stop();
processor.Join();
@@ -85,7 +85,7 @@
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(i::Isolate::Current(), &generator);
processor.Start();
// Enqueue code creation events.
@@ -146,7 +146,7 @@
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(i::Isolate::Current(), &generator);
processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
@@ -236,7 +236,7 @@
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(i::Isolate::Current(), &generator);
processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc Fri Jun 10 02:36:18
2011
+++ /branches/bleeding_edge/test/cctest/test-debug.cc Fri Jun 10 02:42:08
2011
@@ -4728,8 +4728,8 @@
// placing JSON debugger commands in the queue.
class MessageQueueDebuggerThread : public v8::internal::Thread {
public:
- MessageQueueDebuggerThread()
- : Thread("MessageQueueDebuggerThread") { }
+ explicit MessageQueueDebuggerThread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "MessageQueueDebuggerThread") { }
void Run();
};
@@ -4832,7 +4832,8 @@
// This thread runs the v8 engine.
TEST(MessageQueues) {
- MessageQueueDebuggerThread message_queue_debugger_thread;
+ MessageQueueDebuggerThread message_queue_debugger_thread(
+ i::Isolate::Current());
// Create a V8 environment
v8::HandleScope scope;
@@ -4979,13 +4980,15 @@
class V8Thread : public v8::internal::Thread {
public:
- V8Thread() : Thread("V8Thread") { }
+ explicit V8Thread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "V8Thread") { }
void Run();
};
class DebuggerThread : public v8::internal::Thread {
public:
- DebuggerThread() : Thread("DebuggerThread") { }
+ explicit DebuggerThread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "DebuggerThread") { }
void Run();
};
@@ -5062,8 +5065,8 @@
TEST(ThreadedDebugging) {
- DebuggerThread debugger_thread;
- V8Thread v8_thread;
+ DebuggerThread debugger_thread(i::Isolate::Current());
+ V8Thread v8_thread(i::Isolate::Current());
// Create a V8 environment
threaded_debugging_barriers.Initialize();
@@ -5084,14 +5087,16 @@
class BreakpointsV8Thread : public v8::internal::Thread {
public:
- BreakpointsV8Thread() : Thread("BreakpointsV8Thread") { }
+ explicit BreakpointsV8Thread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "BreakpointsV8Thread") { }
void Run();
};
class BreakpointsDebuggerThread : public v8::internal::Thread {
public:
- explicit BreakpointsDebuggerThread(bool global_evaluate)
- : Thread("BreakpointsDebuggerThread"),
+ explicit BreakpointsDebuggerThread(v8::internal::Isolate* isolate,
+ bool global_evaluate)
+ : Thread(isolate, "BreakpointsDebuggerThread"),
global_evaluate_(global_evaluate) {}
void Run();
@@ -5268,8 +5273,9 @@
void TestRecursiveBreakpointsGeneric(bool global_evaluate) {
i::FLAG_debugger_auto_break = true;
- BreakpointsDebuggerThread breakpoints_debugger_thread(global_evaluate);
- BreakpointsV8Thread breakpoints_v8_thread;
+ BreakpointsDebuggerThread
breakpoints_debugger_thread(i::Isolate::Current(),
+ global_evaluate);
+ BreakpointsV8Thread breakpoints_v8_thread(i::Isolate::Current());
// Create a V8 environment
Barriers stack_allocated_breakpoints_barriers;
@@ -5651,13 +5657,15 @@
class HostDispatchV8Thread : public v8::internal::Thread {
public:
- HostDispatchV8Thread() : Thread("HostDispatchV8Thread") { }
+ explicit HostDispatchV8Thread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "HostDispatchV8Thread") { }
void Run();
};
class HostDispatchDebuggerThread : public v8::internal::Thread {
public:
- HostDispatchDebuggerThread() : Thread("HostDispatchDebuggerThread") { }
+ explicit HostDispatchDebuggerThread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "HostDispatchDebuggerThread") { }
void Run();
};
@@ -5729,8 +5737,9 @@
TEST(DebuggerHostDispatch) {
- HostDispatchDebuggerThread host_dispatch_debugger_thread;
- HostDispatchV8Thread host_dispatch_v8_thread;
+ HostDispatchDebuggerThread host_dispatch_debugger_thread(
+ i::Isolate::Current());
+ HostDispatchV8Thread host_dispatch_v8_thread(i::Isolate::Current());
i::FLAG_debugger_auto_break = true;
// Create a V8 environment
@@ -5754,14 +5763,15 @@
class DebugMessageDispatchV8Thread : public v8::internal::Thread {
public:
- DebugMessageDispatchV8Thread() : Thread("DebugMessageDispatchV8Thread")
{ }
+ explicit DebugMessageDispatchV8Thread(v8::internal::Isolate* isolate)
+ : Thread(isolate, "DebugMessageDispatchV8Thread") { }
void Run();
};
class DebugMessageDispatchDebuggerThread : public v8::internal::Thread {
public:
- DebugMessageDispatchDebuggerThread()
- : Thread("DebugMessageDispatchDebuggerThread") { }
+ explicit DebugMessageDispatchDebuggerThread(v8::internal::Isolate*
isolate)
+ : Thread(isolate, "DebugMessageDispatchDebuggerThread") { }
void Run();
};
@@ -5795,8 +5805,10 @@
TEST(DebuggerDebugMessageDispatch) {
- DebugMessageDispatchDebuggerThread
debug_message_dispatch_debugger_thread;
- DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread;
+ DebugMessageDispatchDebuggerThread
debug_message_dispatch_debugger_thread(
+ i::Isolate::Current());
+ DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread(
+ i::Isolate::Current());
i::FLAG_debugger_auto_break = true;
@@ -5861,8 +5873,8 @@
class DebuggerAgentProtocolServerThread : public i::Thread {
public:
- explicit DebuggerAgentProtocolServerThread(int port)
- : Thread("DebuggerAgentProtocolServerThread"),
+ explicit DebuggerAgentProtocolServerThread(i::Isolate* isolate, int port)
+ : Thread(isolate, "DebuggerAgentProtocolServerThread"),
port_(port),
server_(NULL),
client_(NULL),
@@ -5927,7 +5939,7 @@
// Create a socket server to receive a debugger agent message.
DebuggerAgentProtocolServerThread* server =
- new DebuggerAgentProtocolServerThread(kPort);
+ new DebuggerAgentProtocolServerThread(i::Isolate::Current(), kPort);
server->Start();
server->WaitForListening();
=======================================
--- /branches/bleeding_edge/test/cctest/test-lockers.cc Fri Jun 10 02:36:18
2011
+++ /branches/bleeding_edge/test/cctest/test-lockers.cc Fri Jun 10 02:42:08
2011
@@ -64,7 +64,7 @@
public:
KangarooThread(v8::Isolate* isolate,
v8::Handle<v8::Context> context, int value)
- : Thread("KangarooThread"),
+ : Thread(NULL, "KangarooThread"),
isolate_(isolate), context_(context), value_(value) {
}
@@ -149,8 +149,8 @@
private:
class ThreadWithSemaphore : public i::Thread {
public:
- ThreadWithSemaphore(JoinableThread* joinable_thread)
- : Thread(joinable_thread->name_),
+ explicit ThreadWithSemaphore(JoinableThread* joinable_thread)
+ : Thread(NULL, joinable_thread->name_),
joinable_thread_(joinable_thread) {
}
=======================================
--- /branches/bleeding_edge/test/cctest/test-platform-tls.cc Fri Jun 10
02:36:18 2011
+++ /branches/bleeding_edge/test/cctest/test-platform-tls.cc Fri Jun 10
02:42:08 2011
@@ -48,7 +48,7 @@
class TestThread : public Thread {
public:
- TestThread() : Thread("TestThread") {}
+ TestThread() : Thread(NULL, "TestThread") {}
virtual void Run() {
DoTest();
=======================================
--- /branches/bleeding_edge/test/cctest/test-sockets.cc Fri Jun 10 02:36:18
2011
+++ /branches/bleeding_edge/test/cctest/test-sockets.cc Fri Jun 10 02:42:08
2011
@@ -10,8 +10,8 @@
class SocketListenerThread : public Thread {
public:
- SocketListenerThread(int port, int data_size)
- : Thread("SocketListenerThread"),
+ explicit SocketListenerThread(Isolate* isolate, int port, int data_size)
+ : Thread(isolate, "SocketListenerThread"),
port_(port),
data_size_(data_size),
server_(NULL),
@@ -92,7 +92,8 @@
OS::SNPrintF(Vector<char>(port_str, kPortBuferLen), "%d", port);
// Create a socket listener.
- SocketListenerThread* listener = new SocketListenerThread(port, len);
+ SocketListenerThread* listener = new
SocketListenerThread(Isolate::Current(),
+ port, len);
listener->Start();
listener->WaitForListening();
=======================================
--- /branches/bleeding_edge/test/cctest/test-thread-termination.cc Fri Jun
10 02:36:35 2011
+++ /branches/bleeding_edge/test/cctest/test-thread-termination.cc Fri Jun
10 02:42:08 2011
@@ -161,16 +161,12 @@
class TerminatorThread : public v8::internal::Thread {
public:
explicit TerminatorThread(i::Isolate* isolate)
- : Thread("TerminatorThread"),
- isolate_(reinterpret_cast<v8::Isolate*>(isolate)) { }
+ : Thread(isolate, "TerminatorThread") { }
void Run() {
semaphore->Wait();
- CHECK(!v8::V8::IsExecutionTerminating(isolate_));
- v8::V8::TerminateExecution(isolate_);
- }
-
- private:
- v8::Isolate* isolate_;
+ CHECK(!v8::V8::IsExecutionTerminating());
+ v8::V8::TerminateExecution();
+ }
};
@@ -200,7 +196,8 @@
class LoopingThread : public v8::internal::Thread {
public:
- LoopingThread() : Thread("LoopingThread") { }
+ explicit LoopingThread(i::Isolate* isolate)
+ : Thread(isolate, "LoopingThread") { }
void Run() {
v8::Locker locker;
v8::HandleScope scope;
@@ -236,7 +233,7 @@
const int kThreads = 2;
i::List<LoopingThread*> threads(kThreads);
for (int i = 0; i < kThreads; i++) {
- threads.Add(new LoopingThread());
+ threads.Add(new LoopingThread(i::Isolate::Current()));
}
for (int i = 0; i < kThreads; i++) {
threads[i]->Start();
=======================================
--- /branches/bleeding_edge/test/cctest/test-threads.cc Fri Jun 10 02:36:18
2011
+++ /branches/bleeding_edge/test/cctest/test-threads.cc Fri Jun 10 02:42:08
2011
@@ -65,7 +65,7 @@
class ThreadA: public v8::internal::Thread {
public:
- ThreadA() : Thread("ThreadA") { }
+ explicit ThreadA(i::Isolate* isolate) : Thread(isolate, "ThreadA") { }
void Run() {
v8::Locker locker;
v8::HandleScope scope;
@@ -101,7 +101,7 @@
class ThreadB: public v8::internal::Thread {
public:
- ThreadB() : Thread("ThreadB") { }
+ explicit ThreadB(i::Isolate* isolate) : Thread(isolate, "ThreadB") { }
void Run() {
do {
{
@@ -126,8 +126,8 @@
TEST(JSFunctionResultCachesInTwoThreads) {
v8::V8::Initialize();
- ThreadA threadA;
- ThreadB threadB;
+ ThreadA threadA(i::Isolate::Current());
+ ThreadB threadB(i::Isolate::Current());
threadA.Start();
threadB.Start();
@@ -144,7 +144,7 @@
i::List<i::ThreadId>* refs,
unsigned int thread_no,
i::Semaphore* semaphore)
- : Thread("ThreadRefValidationThread"),
+ : Thread(NULL, "ThreadRefValidationThread"),
refs_(refs), thread_no_(thread_no),
thread_to_start_(thread_to_start),
semaphore_(semaphore) {
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev