Search in sources :

Example 1 with Clazz

use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Clazz in project graal by oracle.

the class CommonPointerLibraries method isMemberReadable.

@ExportMessage
static boolean isMemberReadable(LLVMPointerImpl receiver, String ident, @Shared("isObject") @Cached ConditionProfile isObject) {
    if (isObject.profile(receiver.getExportType() instanceof LLVMInteropType.Clazz)) {
        LLVMInteropType.Clazz clazz = (LLVMInteropType.Clazz) receiver.getExportType();
        LLVMInteropType.StructMember member = clazz.findMember(ident);
        if (member == null) {
            LLVMInteropType.Method method = clazz.findMethod(ident);
            return method != null;
        }
        return member != null;
    } else if (isObject.profile(receiver.getExportType() instanceof LLVMInteropType.Struct)) {
        LLVMInteropType.Struct struct = (LLVMInteropType.Struct) receiver.getExportType();
        LLVMInteropType.StructMember member = struct.findMember(ident);
        return member != null;
    } else {
        return false;
    }
}
Also used : Clazz(com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Clazz) Clazz(com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Clazz) LLVMInteropType(com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType) ExportMessage(com.oracle.truffle.api.library.ExportMessage)

Aggregations

ExportMessage (com.oracle.truffle.api.library.ExportMessage)1 LLVMInteropType (com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType)1 Clazz (com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType.Clazz)1