use of com.oracle.svm.jni.nativeapi.JNIInvokeInterface in project graal by oracle.
the class JNIFunctionTables method getGlobalJavaVM.
public JNIJavaVM getGlobalJavaVM() {
if (globalJavaVM.isNull()) {
JNIInvokeInterface invokes = UnmanagedMemory.calloc(SizeOf.get(JNIInvokeInterface.class));
invokesInitializer.initialize(invokes);
invokes.setIsolate(CEntryPointContext.getCurrentIsolate());
globalJavaVM = UnmanagedMemory.calloc(SizeOf.get(JNIJavaVM.class));
globalJavaVM.setFunctions(invokes);
}
return globalJavaVM;
}
use of com.oracle.svm.jni.nativeapi.JNIInvokeInterface in project graal by oracle.
the class JNIFunctionTablesFeature method beforeCompilation.
@Override
public void beforeCompilation(BeforeCompilationAccess a) {
BeforeCompilationAccessImpl access = (BeforeCompilationAccessImpl) a;
HostedMetaAccess metaAccess = access.getMetaAccess();
CFunctionPointer unimplementedWithJavaVMArgument = getStubFunctionPointer(access, (HostedMethod) getSingleMethod(metaAccess, UnimplementedWithJavaVMArgument.class));
JNIStructFunctionsInitializer<JNIInvokeInterface> invokesInitializer = buildInvokesInitializer(access, unimplementedWithJavaVMArgument);
CFunctionPointer unimplementedWithJNIEnvArgument = getStubFunctionPointer(access, (HostedMethod) getSingleMethod(metaAccess, UnimplementedWithJNIEnvArgument.class));
JNIStructFunctionsInitializer<JNINativeInterface> functionsInitializer = buildFunctionsInitializer(access, unimplementedWithJNIEnvArgument);
JNIFunctionTables.singleton().initialize(invokesInitializer, functionsInitializer);
}
Aggregations