static void enter(JNIJavaVMPointer vmBuf, JNIEnvironmentPointer penv, JNIJavaVMInitArgs vmArgs) { if (!SubstrateOptions.SpawnIsolates.getValue()) { int error = CEntryPointActions.enterIsolate((Isolate) CEntryPointSetup.SINGLE_ISOLATE_SENTINEL); if (error != CEntryPointErrors.UNINITIALIZED_ISOLATE) { if (error == CEntryPointErrors.NO_ERROR) { CEntryPointActions.leave(); } CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_EEXIST()); } } if (CEntryPointActions.enterCreateIsolate(WordFactory.nullPointer()) != 0) { CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_ERR()); } } }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint(name = "tear_down_isolate", documentation = { "Tears down the passed isolate, waiting for any attached threads to detach from", "it, then discards the isolate's objects, threads, and any other state or context", "that is associated with it.", "Returns 0 on success, or a non-zero value on failure."}) @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, nameTransformation = NameTransformation.class) public static int tearDownIsolate(IsolateThread isolateThread) { int result = CEntryPointActions.enter(isolateThread); if (result != 0) { CEntryPointActions.leave(); return result; } return CEntryPointActions.leaveTearDownIsolate(); }
static void enter(NativeTruffleContext context) { if (CEntryPointActions.enterAttachThread(context.isolate()) != 0) { CEntryPointActions.bailoutInPrologue(WordFactory.nullPointer()); } } }
static void leave() { int code = CEntryPointActions.leave(); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void leave() { int code = CEntryPointActions.leaveTearDownIsolate(); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void leave() { int code = CEntryPointActions.leaveDetachThread(); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint(name = "detach_thread", documentation = { "Detaches the passed isolate thread from its isolate and discards any state or", "context that is associated with it. At the time of the call, no code may still", "be executing in the isolate thread's context.", "Returns 0 on success, or a non-zero value on failure."}) @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, nameTransformation = NameTransformation.class) public static int detachThread(IsolateThread thread) { int result = CEntryPointActions.enter(thread); if (result != 0) { CEntryPointActions.leave(); return result; } result = CEntryPointActions.leaveDetachThread(); return result; }
static void enter(JNIJavaVM vm, WordPointer env, int version) { if (vm.isNull() || env.isNull()) { CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_ERR()); } if (version != JNI_VERSION_1_8() && version != JNI_VERSION_1_6() && version != JNI_VERSION_1_4() && version != JNI_VERSION_1_2() && version != JNI_VERSION_1_1()) { env.write(WordFactory.nullPointer()); CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_EVERSION()); } if (!CEntryPointActions.isCurrentThreadAttachedTo(vm.getFunctions().getIsolate())) { env.write(WordFactory.nullPointer()); CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_EDETACHED()); } if (CEntryPointActions.enterIsolate(vm.getFunctions().getIsolate()) != 0) { CEntryPointActions.bailoutInPrologue(JNIErrors.JNI_ERR()); } } }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, publishAs = Publish.NotPublished) @CEntryPointBuiltinImplementation(builtin = Builtin.ATTACH_THREAD) public static IsolateThread attachThread(Isolate isolate) { IsolateThread result = WordFactory.nullPointer(); int status = CEntryPointActions.enterAttachThread(isolate); if (status == 0) { result = CurrentIsolate.getCurrentThread(); status = CEntryPointActions.leave(); } return result; }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, publishAs = Publish.NotPublished) @CEntryPointBuiltinImplementation(builtin = Builtin.CREATE_ISOLATE) public static IsolateThread createIsolate() { IsolateThread result = WordFactory.nullPointer(); int status = CEntryPointActions.enterCreateIsolate(WordFactory.nullPointer()); if (status == 0) { result = CurrentIsolate.getCurrentThread(); CEntryPointActions.leave(); } return result; }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint(name = "get_current_thread", documentation = { "Given an isolate to which the current thread is attached, returns the address of", "the thread's associated isolate thread structure. If the current thread is not", "attached to the passed isolate or if another error occurs, returns NULL."}) @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, nameTransformation = NameTransformation.class) public static IsolateThread getCurrentThread(Isolate isolate) { int result = CEntryPointActions.enterIsolate(isolate); if (result != 0) { return WordFactory.nullPointer(); } IsolateThread thread = CurrentIsolate.getCurrentThread(); if (CEntryPointActions.leave() != 0) { thread = WordFactory.nullPointer(); } return thread; }
static void enter(NativeTruffleContext context) { if (CEntryPointActions.enterIsolate(context.isolate()) != 0) { CEntryPointActions.bailoutInPrologue(WordFactory.nullPointer()); } } }
@Uninterruptible(reason = UNINTERRUPTIBLE_REASON) @CEntryPoint @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, publishAs = Publish.NotPublished) @CEntryPointBuiltinImplementation(builtin = Builtin.GET_ISOLATE) public static Isolate getIsolate(IsolateThread thread) { int status = CEntryPointActions.enter(thread); if (status != 0) { return WordFactory.nullPointer(); } Isolate isolate = CurrentIsolate.getIsolate(); if (CEntryPointActions.leave() != 0) { isolate = WordFactory.nullPointer(); } return isolate; }
@SuppressWarnings("unused") static void enter(ThreadStartData data) { int code = CEntryPointActions.enterAttachThread(data.getIsolate()); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void enter(Isolate isolate) { int code = CEntryPointActions.enterIsolate(isolate); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void enter(IsolateThread thread) { int code = CEntryPointActions.enter(thread); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void enter() { int code = CEntryPointActions.enterCreateIsolate(WordFactory.nullPointer()); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
static void enter(ClosureData user) { CEntryPointActions.enterIsolate(user.isolate()); } }
public static void enter(JNIEnvironment env) { CEntryPointActions.enter((IsolateThread) env); } }
static void enter(JNIJavaVM vm) { CEntryPointActions.enterAttachThread(vm.getFunctions().getIsolate()); } }