static void enter() { int code = CEntryPointActions.enterCreateIsolate(WordFactory.nullPointer()); if (code != 0) { CEntryPointActions.failFatally(code, errorMessage.get()); } } }
@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; }
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 = "create_isolate", documentation = { "Create a new isolate, considering the passed parameters (which may be NULL).", "Returns 0 on success, or a non-zero value on failure.", "On success, the current thread is attached to the created isolate, and the", "address of the isolate and the isolate thread are written to the passed pointers", "if they are not NULL."}) @CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, nameTransformation = NameTransformation.class) public static int createIsolate(CEntryPointCreateIsolateParameters params, IsolatePointer isolate, IsolateThreadPointer thread) { int result = CEntryPointActions.enterCreateIsolate(params); if (result == 0) { if (isolate.isNonNull()) { isolate.write(CurrentIsolate.getIsolate()); } if (thread.isNonNull()) { thread.write(CurrentIsolate.getCurrentThread()); } result = CEntryPointActions.leave(); } return result; }