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

Unified Diff: test/cctest/test-debug.cc

Issue 10417010: Run Crankshaft on a separate thread. (Closed) Base URL: https://chromiumcodereview.appspot.com/10387157
Patch Set: Created 8 years, 7 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
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index e40f406c3c5f869743cb13e2f0d75b4afb95b480..87d77d946e98df18e06ae2cde974abe4999645b8 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -5043,16 +5043,20 @@ void V8Thread::Run() {
"foo();\n";
v8::V8::Initialize();
- v8::HandleScope scope;
- DebugLocalContext env;
- v8::Debug::SetMessageHandler2(&ThreadedMessageHandler);
- v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
- global_template->Set(v8::String::New("ThreadedAtBarrier1"),
- v8::FunctionTemplate::New(ThreadedAtBarrier1));
- v8::Handle<v8::Context> context = v8::Context::New(NULL, global_template);
- v8::Context::Scope context_scope(context);
+ {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ v8::Debug::SetMessageHandler2(&ThreadedMessageHandler);
+ v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
+ global_template->Set(v8::String::New("ThreadedAtBarrier1"),
+ v8::FunctionTemplate::New(ThreadedAtBarrier1));
+ v8::Handle<v8::Context> context = v8::Context::New(NULL, global_template);
+ v8::Context::Scope context_scope(context);
+
+ CompileRun(source);
+ }
- CompileRun(source);
+ v8::V8::Dispose();
}
void DebuggerThread::Run() {
@@ -5156,14 +5160,18 @@ void BreakpointsV8Thread::Run() {
"cat(19);\n";
v8::V8::Initialize();
- v8::HandleScope scope;
- DebugLocalContext env;
- v8::Debug::SetMessageHandler2(&BreakpointsMessageHandler);
+ {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ v8::Debug::SetMessageHandler2(&BreakpointsMessageHandler);
- CompileRun(source_1);
- breakpoints_barriers->barrier_1.Wait();
- breakpoints_barriers->barrier_2.Wait();
- CompileRun(source_2);
+ CompileRun(source_1);
+ breakpoints_barriers->barrier_1.Wait();
+ breakpoints_barriers->barrier_2.Wait();
+ CompileRun(source_2);
+ }
+
+ v8::V8::Dispose();
}
@@ -5701,17 +5709,21 @@ void HostDispatchV8Thread::Run() {
const char* source_2 = "cat(17);\n";
v8::V8::Initialize();
- v8::HandleScope scope;
- DebugLocalContext env;
+ {
+ v8::HandleScope scope;
+ DebugLocalContext env;
- // Set up message and host dispatch handlers.
- v8::Debug::SetMessageHandler2(HostDispatchMessageHandler);
- v8::Debug::SetHostDispatchHandler(HostDispatchDispatchHandler, 10 /* ms */);
+ // Set up message and host dispatch handlers.
+ v8::Debug::SetMessageHandler2(HostDispatchMessageHandler);
+ v8::Debug::SetHostDispatchHandler(HostDispatchDispatchHandler, 10 /* ms */);
- CompileRun(source_1);
- host_dispatch_barriers->barrier_1.Wait();
- host_dispatch_barriers->barrier_2.Wait();
- CompileRun(source_2);
+ CompileRun(source_1);
+ host_dispatch_barriers->barrier_1.Wait();
+ host_dispatch_barriers->barrier_2.Wait();
+ CompileRun(source_2);
+ }
+
+ v8::V8::Dispose();
}
@@ -5789,16 +5801,20 @@ static void DebugMessageHandler() {
void DebugMessageDispatchV8Thread::Run() {
v8::V8::Initialize();
- v8::HandleScope scope;
- DebugLocalContext env;
+ {
+ v8::HandleScope scope;
+ DebugLocalContext env;
- // Set up debug message dispatch handler.
- v8::Debug::SetDebugMessageDispatchHandler(DebugMessageHandler);
+ // Set up debug message dispatch handler.
+ v8::Debug::SetDebugMessageDispatchHandler(DebugMessageHandler);
- CompileRun("var y = 1 + 2;\n");
- debug_message_dispatch_barriers->barrier_1.Wait();
- debug_message_dispatch_barriers->semaphore_1->Wait();
- debug_message_dispatch_barriers->barrier_2.Wait();
+ CompileRun("var y = 1 + 2;\n");
+ debug_message_dispatch_barriers->barrier_1.Wait();
+ debug_message_dispatch_barriers->semaphore_1->Wait();
+ debug_message_dispatch_barriers->barrier_2.Wait();
+ }
+
+ v8::V8::Dispose();
}
« src/v8.cc ('K') | « src/v8threads.cc ('k') | test/cctest/test-deoptimization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698