Search in sources :

Example 1 with LLVMForeignCallNode

use of com.oracle.truffle.llvm.runtime.interop.LLVMForeignCallNode in project graal by oracle.

the class LLVMFunctionCode method initForeignConstructorCallTarget.

@TruffleBoundary
private void initForeignConstructorCallTarget() {
    synchronized (this) {
        if (foreignConstructorCallTarget != null) {
            return;
        }
        LLVMLanguage language = LLVMLanguage.get(null);
        LLVMSourceFunctionType sourceType = getFunction().getSourceType();
        LLVMInteropType interopType = language.getInteropType(sourceType);
        LLVMInteropType extractedType = ((LLVMInteropType.Function) interopType).getParameter(0);
        if (extractedType instanceof LLVMInteropType.Value) {
            LLVMInteropType.Structured structured = ((LLVMInteropType.Value) extractedType).baseType;
            LLVMForeignCallNode foreignCall = LLVMForeignConstructorCallNode.create(language, this, interopType, sourceType, structured);
            foreignConstructorCallTarget = foreignCall.getCallTarget();
        }
    }
}
Also used : LLVMForeignCallNode(com.oracle.truffle.llvm.runtime.interop.LLVMForeignCallNode) LLVMSourceFunctionType(com.oracle.truffle.llvm.runtime.debug.type.LLVMSourceFunctionType) LLVMInteropType(com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType) TruffleBoundary(com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)

Aggregations

TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)1 LLVMSourceFunctionType (com.oracle.truffle.llvm.runtime.debug.type.LLVMSourceFunctionType)1 LLVMForeignCallNode (com.oracle.truffle.llvm.runtime.interop.LLVMForeignCallNode)1 LLVMInteropType (com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType)1