static void initialize() { ImageSingletons.add(IsolateSupport.class, new IsolateSupportImpl()); }
@Override public void afterRegistration(AfterRegistrationAccess access) { IsolateSupportImpl.initialize(); } }
@Override public void detachThread(IsolateThread thread) throws IsolateException { throwOnError(CEntryPointNativeFunctions.detachThread(thread)); }
@Override public IsolateThread attachCurrentThread(Isolate isolate) throws IsolateException { IsolateThreadPointer isolateThread = StackValue.get(IsolateThreadPointer.class); throwOnError(CEntryPointNativeFunctions.attachThread(isolate, isolateThread)); return isolateThread.read(); }
@Override public void tearDownIsolate(IsolateThread thread) throws IsolateException { if (SubstrateOptions.SpawnIsolates.getValue()) { throwOnError(CEntryPointNativeFunctions.tearDownIsolate(thread)); } else { throw new IsolateException(ISOLATES_DISABLED_MESSAGE); } }
@Override public IsolateThread createIsolate(CreateIsolateParameters parameters) throws IsolateException { if (!SubstrateOptions.SpawnIsolates.getValue()) { throw new IsolateException(ISOLATES_DISABLED_MESSAGE); } CEntryPointCreateIsolateParameters params = StackValue.get(CEntryPointCreateIsolateParameters.class); params.setReservedSpaceSize(parameters.getReservedAddressSpaceSize()); params.setVersion(1); IsolateThreadPointer isolateThreadPtr = StackValue.get(IsolateThreadPointer.class); throwOnError(CEntryPointNativeFunctions.createIsolate(params, WordFactory.nullPointer(), isolateThreadPtr)); return isolateThreadPtr.read(); }