diff options
Diffstat (limited to 'deps/v8/test/cctest/test-thread-termination.cc')
-rw-r--r-- | deps/v8/test/cctest/test-thread-termination.cc | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/deps/v8/test/cctest/test-thread-termination.cc b/deps/v8/test/cctest/test-thread-termination.cc index 0c6c0b6a0a..af8e41d2cf 100644 --- a/deps/v8/test/cctest/test-thread-termination.cc +++ b/deps/v8/test/cctest/test-thread-termination.cc @@ -33,9 +33,7 @@ #include "src/base/platform/platform.h" - -v8::base::Semaphore* semaphore = NULL; - +v8::base::Semaphore* semaphore = nullptr; void Signal(const v8::FunctionCallbackInfo<v8::Value>& args) { semaphore->Signal(); @@ -129,7 +127,7 @@ TEST(TerminateOnlyV8ThreadFromThreadItself) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate(CcTest::isolate(), TerminateCurrentThread, DoLoop); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); CHECK(!CcTest::isolate()->IsExecutionTerminating()); // Run a loop that will be infinite if thread termination does not work. @@ -152,7 +150,7 @@ TEST(TerminateOnlyV8ThreadFromThreadItselfNoLoop) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate( CcTest::isolate(), TerminateCurrentThread, DoLoopNoCall); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); CHECK(!CcTest::isolate()->IsExecutionTerminating()); // Run a loop that will be infinite if thread termination does not work. @@ -194,7 +192,7 @@ TEST(TerminateOnlyV8ThreadFromOtherThread) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate(CcTest::isolate(), Signal, DoLoop); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); CHECK(!CcTest::isolate()->IsExecutionTerminating()); // Run a loop that will be infinite if thread termination does not work. @@ -204,7 +202,7 @@ TEST(TerminateOnlyV8ThreadFromOtherThread) { CHECK(result.IsEmpty()); thread.Join(); delete semaphore; - semaphore = NULL; + semaphore = nullptr; } // Test that execution can be terminated from within JSON.stringify. @@ -217,7 +215,7 @@ TEST(TerminateJsonStringify) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate(CcTest::isolate(), Signal, DoLoop); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); CHECK(!CcTest::isolate()->IsExecutionTerminating()); v8::MaybeLocal<v8::Value> result = @@ -230,7 +228,7 @@ TEST(TerminateJsonStringify) { CHECK(result.IsEmpty()); thread.Join(); delete semaphore; - semaphore = NULL; + semaphore = nullptr; } int call_count = 0; @@ -289,7 +287,7 @@ TEST(TerminateLoadICException) { global->Set(v8_str("loop"), v8::FunctionTemplate::New(isolate, LoopGetProperty)); - v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); + v8::Local<v8::Context> context = v8::Context::New(isolate, nullptr, global); v8::Context::Scope context_scope(context); CHECK(!isolate->IsExecutionTerminating()); // Run a loop that will be infinite if thread termination does not work. @@ -336,7 +334,7 @@ TEST(TerminateAndReenterFromThreadItself) { v8::HandleScope scope(isolate); v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate( isolate, TerminateCurrentThread, ReenterAfterTermination); - v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); + v8::Local<v8::Context> context = v8::Context::New(isolate, nullptr, global); v8::Context::Scope context_scope(context); CHECK(!v8::Isolate::GetCurrent()->IsExecutionTerminating()); // Create script strings upfront as it won't work when terminating. @@ -394,7 +392,7 @@ TEST(TerminateCancelTerminateFromThreadItself) { v8::HandleScope scope(isolate); v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate( isolate, TerminateCurrentThread, DoLoopCancelTerminate); - v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); + v8::Local<v8::Context> context = v8::Context::New(isolate, nullptr, global); v8::Context::Scope context_scope(context); CHECK(!CcTest::isolate()->IsExecutionTerminating()); // Check that execution completed with correct return value. @@ -436,7 +434,7 @@ TEST(TerminateFromOtherThreadWhileMicrotaskRunning) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate(CcTest::isolate(), Signal, DoLoop); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); isolate->EnqueueMicrotask( v8::Function::New(isolate->GetCurrentContext(), MicrotaskLoopForever) @@ -453,7 +451,7 @@ TEST(TerminateFromOtherThreadWhileMicrotaskRunning) { thread.Join(); delete semaphore; - semaphore = NULL; + semaphore = nullptr; } @@ -471,7 +469,7 @@ TEST(PostponeTerminateException) { v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate(CcTest::isolate(), TerminateCurrentThread, DoLoop); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global); + v8::Context::New(CcTest::isolate(), nullptr, global); v8::Context::Scope context_scope(context); v8::TryCatch try_catch(isolate); @@ -483,7 +481,7 @@ TEST(PostponeTerminateException) { i::StackGuard::TERMINATE_EXECUTION); // API interrupts should still be triggered. - CcTest::isolate()->RequestInterrupt(&CounterCallback, NULL); + CcTest::isolate()->RequestInterrupt(&CounterCallback, nullptr); CHECK_EQ(0, callback_counter); CompileRun(terminate_and_loop); CHECK(!try_catch.HasTerminated()); @@ -494,7 +492,7 @@ TEST(PostponeTerminateException) { i::StackGuard::API_INTERRUPT); // None of the two interrupts should trigger. - CcTest::isolate()->RequestInterrupt(&CounterCallback, NULL); + CcTest::isolate()->RequestInterrupt(&CounterCallback, nullptr); CompileRun(terminate_and_loop); CHECK(!try_catch.HasTerminated()); CHECK_EQ(1, callback_counter); @@ -551,7 +549,7 @@ TEST(TerminationInInnerTryCall) { v8_str("inner_try_call_terminate"), v8::FunctionTemplate::New(isolate, InnerTryCallTerminate)); v8::Local<v8::Context> context = - v8::Context::New(CcTest::isolate(), NULL, global_template); + v8::Context::New(CcTest::isolate(), nullptr, global_template); v8::Context::Scope context_scope(context); { v8::TryCatch try_catch(isolate); @@ -571,7 +569,7 @@ TEST(TerminateAndTryCall) { v8::HandleScope scope(isolate); v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate( isolate, TerminateCurrentThread, DoLoopCancelTerminate); - v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); + v8::Local<v8::Context> context = v8::Context::New(isolate, nullptr, global); v8::Context::Scope context_scope(context); CHECK(!isolate->IsExecutionTerminating()); v8::TryCatch try_catch(isolate); @@ -612,7 +610,7 @@ TEST(TerminateConsole) { v8::HandleScope scope(isolate); v8::Local<v8::ObjectTemplate> global = CreateGlobalTemplate( isolate, TerminateCurrentThread, DoLoopCancelTerminate); - v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); + v8::Local<v8::Context> context = v8::Context::New(isolate, nullptr, global); v8::Context::Scope context_scope(context); CHECK(!isolate->IsExecutionTerminating()); v8::TryCatch try_catch(isolate); |