Search in sources :

Example 1 with StructInfo

use of com.oracle.svm.hosted.c.info.StructInfo in project graal by oracle.

the class JNIJavaCallWrapperMethod method getJNIValueOffsetOf.

private StructFieldInfo getJNIValueOffsetOf(ResolvedJavaType jniValueType, JavaKind kind) {
    String name = String.valueOf(kind.isObject() ? 'l' : Character.toLowerCase(kind.getTypeChar()));
    StructInfo structInfo = (StructInfo) nativeLibs.findElementInfo(jniValueType);
    for (ElementInfo elementInfo : structInfo.getChildren()) {
        if (elementInfo instanceof StructFieldInfo) {
            StructFieldInfo fieldInfo = (StructFieldInfo) elementInfo;
            if (name.equals(fieldInfo.getName())) {
                return fieldInfo;
            }
        }
    }
    throw VMError.shouldNotReachHere();
}
Also used : StructInfo(com.oracle.svm.hosted.c.info.StructInfo) ElementInfo(com.oracle.svm.hosted.c.info.ElementInfo) StructFieldInfo(com.oracle.svm.hosted.c.info.StructFieldInfo)

Aggregations

ElementInfo (com.oracle.svm.hosted.c.info.ElementInfo)1 StructFieldInfo (com.oracle.svm.hosted.c.info.StructFieldInfo)1 StructInfo (com.oracle.svm.hosted.c.info.StructInfo)1