Search in sources :

Example 1 with JNIInvokeInterface

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;
}
Also used : JNIInvokeInterface(com.oracle.svm.jni.nativeapi.JNIInvokeInterface)

Example 2 with JNIInvokeInterface

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);
}
Also used : JNIInvokeInterface(com.oracle.svm.jni.nativeapi.JNIInvokeInterface) CFunctionPointer(org.graalvm.nativeimage.c.function.CFunctionPointer) JNINativeInterface(com.oracle.svm.jni.nativeapi.JNINativeInterface) HostedMetaAccess(com.oracle.svm.hosted.meta.HostedMetaAccess) BeforeCompilationAccessImpl(com.oracle.svm.hosted.FeatureImpl.BeforeCompilationAccessImpl)

Aggregations

JNIInvokeInterface (com.oracle.svm.jni.nativeapi.JNIInvokeInterface)2 BeforeCompilationAccessImpl (com.oracle.svm.hosted.FeatureImpl.BeforeCompilationAccessImpl)1 HostedMetaAccess (com.oracle.svm.hosted.meta.HostedMetaAccess)1 JNINativeInterface (com.oracle.svm.jni.nativeapi.JNINativeInterface)1 CFunctionPointer (org.graalvm.nativeimage.c.function.CFunctionPointer)1