use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Method in project graal by oracle.
the class LLVMInteropInvokeNode method doClazz.
@Specialization
@GenerateAOT.Exclude
Object doClazz(LLVMPointer receiver, LLVMInteropType.Clazz type, String method, Object[] arguments, @Cached LLVMInteropMethodInvokeNode invoke, @Cached LLVMSelfArgumentPackNode selfPackNode, @CachedLibrary(limit = "5") InteropLibrary interop) throws ArityException, UnknownIdentifierException, UnsupportedTypeException, UnsupportedMessageException {
Object[] selfArgs = selfPackNode.execute(receiver, arguments);
Method methodObject = type.findMethodByArgumentsWithSelf(method, selfArgs);
if (methodObject == null) {
return doStruct(receiver, type, method, arguments, interop);
}
long virtualIndex = methodObject.getVirtualIndex();
return invoke.execute(receiver, method, type, methodObject, virtualIndex, selfArgs);
}
use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Method in project graal by oracle.
the class LLVMInteropNonvirtualCallNode method doResolve.
/**
* @param receiver
* @param method
*/
@Specialization
@GenerateAOT.Exclude
Object doResolve(LLVMPointer receiver, LLVMInteropType.Clazz type, String methodName, Method method, Object[] arguments, @Cached LLVMDynAccessSymbolNode dynAccessSymbolNode, @CachedLibrary(limit = "5") InteropLibrary interop, @Cached BranchProfile notFound) throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
Method newMethod = type.findMethodByArgumentsWithSelf(methodName, arguments);
LLVMFunction newLLVMFunction = getLLVMFunction(newMethod, type, notFound);
Object newReceiver = dynAccessSymbolNode.execute(newLLVMFunction);
return interop.execute(newReceiver, arguments);
}
Aggregations