Search in sources :

Example 16 with Signature

use of jdk.vm.ci.meta.Signature in project graal by oracle.

the class StampFactory method createParameterStamps.

public static Stamp[] createParameterStamps(Assumptions assumptions, ResolvedJavaMethod method, boolean trustInterfaceTypes) {
    Signature signature = method.getSignature();
    Stamp[] result = new Stamp[signature.getParameterCount(method.hasReceiver())];
    int index = 0;
    ResolvedJavaType accessingClass = method.getDeclaringClass();
    if (method.hasReceiver()) {
        if (trustInterfaceTypes) {
            result[index++] = StampFactory.objectNonNull(TypeReference.createTrusted(assumptions, accessingClass));
        } else {
            result[index++] = StampFactory.objectNonNull(TypeReference.create(assumptions, accessingClass));
        }
    }
    for (int i = 0; i < signature.getParameterCount(false); i++) {
        JavaType type = signature.getParameterType(i, accessingClass);
        JavaKind kind = type.getJavaKind();
        Stamp stamp;
        if (kind == JavaKind.Object && type instanceof ResolvedJavaType) {
            if (trustInterfaceTypes) {
                stamp = StampFactory.object(TypeReference.createTrusted(assumptions, (ResolvedJavaType) type));
            } else {
                stamp = StampFactory.object(TypeReference.create(assumptions, (ResolvedJavaType) type));
            }
        } else {
            stamp = StampFactory.forKind(kind);
        }
        result[index++] = stamp;
    }
    return result;
}
Also used : JavaType(jdk.vm.ci.meta.JavaType) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType) Signature(jdk.vm.ci.meta.Signature) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType) JavaKind(jdk.vm.ci.meta.JavaKind)

Aggregations

Signature (jdk.vm.ci.meta.Signature)16 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)10 JavaType (jdk.vm.ci.meta.JavaType)9 JavaKind (jdk.vm.ci.meta.JavaKind)8 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)6 ValueNode (org.graalvm.compiler.nodes.ValueNode)5 FrameStateBuilder (org.graalvm.compiler.java.FrameStateBuilder)4 StampPair (org.graalvm.compiler.core.common.type.StampPair)3 InvokeKind (org.graalvm.compiler.nodes.CallTargetNode.InvokeKind)3 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)3 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)3 CFunction (org.graalvm.nativeimage.c.function.CFunction)3 CGlobalDataLoadAddressNode (com.oracle.svm.core.graal.nodes.CGlobalDataLoadAddressNode)2 SharedMethod (com.oracle.svm.core.meta.SharedMethod)2 NativeLibraries (com.oracle.svm.hosted.c.NativeLibraries)2 JNIEnvironment (com.oracle.svm.jni.nativeapi.JNIEnvironment)2 ArrayList (java.util.ArrayList)2 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)2 TypeReference (org.graalvm.compiler.core.common.type.TypeReference)2 InvokeNode (org.graalvm.compiler.nodes.InvokeNode)2