use of com.oracle.svm.jni.nativeapi.JNINativeInterface in project graal by oracle.
the class JNIFunctionTables method getGlobalFunctionTable.
public JNINativeInterface getGlobalFunctionTable() {
if (globalFunctionTable.isNull()) {
JNINativeInterface functionTable = UnmanagedMemory.malloc(SizeOf.get(JNINativeInterface.class));
functionTableInitializer.initialize(functionTable);
globalFunctionTable = functionTable;
}
return globalFunctionTable;
}
use of com.oracle.svm.jni.nativeapi.JNINativeInterface 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