#include "include/v8-function.h"
#include "include/v8-locker.h"
#include "src/api/api-inl.h"
#include "src/base/platform/platform.h"
#include "src/execution/interrupts-scope.h"
#include "src/execution/isolate.h"
#include "src/init/v8.h"
#include "src/objects/objects-inl.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock-support.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
base::Semaphore* semaphore = …;
class TerminatorThread : public base::Thread { … };
void Signal(const FunctionCallbackInfo<Value>& info) { … }
MaybeLocal<Value> CompileRun(Local<Context> context, Local<String> source) { … }
MaybeLocal<Value> CompileRun(Local<Context> context, const char* source) { … }
void DoLoop(const FunctionCallbackInfo<Value>& info) { … }
void Fail(const FunctionCallbackInfo<Value>& info) { … }
void Loop(const FunctionCallbackInfo<Value>& info) { … }
void TerminateCurrentThread(const FunctionCallbackInfo<Value>& info) { … }
class ThreadTerminationTest : public TestWithIsolate { … };
void DoLoopNoCall(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, TerminateOnlyV8ThreadFromThreadItself) { … }
TEST_F(ThreadTerminationTest, TerminateOnlyV8ThreadFromThreadItselfNoLoop) { … }
TEST_F(ThreadTerminationTest, TerminateOnlyV8ThreadFromOtherThread) { … }
TEST_F(ThreadTerminationTest, TerminateJsonStringify) { … }
TEST_F(ThreadTerminationTest, TerminateBigIntMultiplication) { … }
TEST_F(ThreadTerminationTest, TerminateOptimizedBigIntMultiplication) { … }
TEST_F(ThreadTerminationTest, TerminateBigIntDivision) { … }
TEST_F(ThreadTerminationTest, TerminateOptimizedBigIntDivision) { … }
TEST_F(ThreadTerminationTest, TerminateBigIntToString) { … }
TEST_F(ThreadTerminationTest, TerminateBigIntFromString) { … }
void LoopGetProperty(const FunctionCallbackInfo<Value>& info) { … }
int call_count = …;
void TerminateOrReturnObject(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, TerminateLoadICException) { … }
Persistent<String> reenter_script_1;
Persistent<String> reenter_script_2;
void DoLoopCancelTerminate(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, TerminateCancelTerminateFromThreadItself) { … }
void MicrotaskShouldNotRun(const FunctionCallbackInfo<Value>& info) { … }
void MicrotaskLoopForever(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, TerminateFromOtherThreadWhileMicrotaskRunning) { … }
static int callback_counter = …;
static void CounterCallback(Isolate* isolate, void* data) { … }
TEST_F(ThreadTerminationTest, PostponeTerminateException) { … }
static void AssertFinishedCodeRun(Isolate* isolate) { … }
void RequestTermianteAndCallAPI(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, ErrorObjectAfterTermination) { … }
void InnerTryCallTerminate(const FunctionCallbackInfo<Value>& info) { … }
TEST_F(ThreadTerminationTest, TerminationInInnerTryCall) { … }
TEST_F(ThreadTerminationTest, TerminateAndTryCall) { … }
class ConsoleImpl : public debug::ConsoleDelegate { … };
TEST_F(ThreadTerminationTest, TerminateConsole) { … }
TEST_F(ThreadTerminationTest, TerminationClearArrayJoinStack) { … }
class TerminatorSleeperThread : public base::Thread { … };
TEST_F(ThreadTerminationTest, TerminateRegExp) { … }
TEST_F(ThreadTerminationTest, TerminateInMicrotask) { … }
void TerminationMicrotask(void* data) { … }
void UnreachableMicrotask(void* data) { … }
TEST_F(ThreadTerminationTest, TerminateInApiMicrotask) { … }
}