Search in sources :

Example 1 with SubstrateSignature

use of com.oracle.svm.graal.meta.SubstrateSignature in project graal by oracle.

the class GraalObjectReplacer method registerImmutableObjects.

public void registerImmutableObjects(CompilationAccess access) {
    for (SubstrateMethod method : methods.values()) {
        access.registerAsImmutable(method);
        access.registerAsImmutable(method.getRawImplementations());
        access.registerAsImmutable(method.getEncodedLineNumberTable());
    }
    for (SubstrateField field : fields.values()) {
        access.registerAsImmutable(field);
    }
    for (FieldLocationIdentity fieldLocationIdentity : fieldLocationIdentities.values()) {
        access.registerAsImmutable(fieldLocationIdentity);
    }
    for (SubstrateType type : types.values()) {
        access.registerAsImmutable(type);
        access.registerAsImmutable(type.getRawInstanceFields());
    }
    for (SubstrateSignature signature : signatures.values()) {
        access.registerAsImmutable(signature);
        access.registerAsImmutable(signature.getRawParameterTypes());
    }
}
Also used : SubstrateMethod(com.oracle.svm.graal.meta.SubstrateMethod) FieldLocationIdentity(org.graalvm.compiler.nodes.FieldLocationIdentity) SubstrateFieldLocationIdentity(com.oracle.svm.core.graal.nodes.SubstrateFieldLocationIdentity) SubstrateField(com.oracle.svm.graal.meta.SubstrateField) SubstrateType(com.oracle.svm.graal.meta.SubstrateType) SubstrateSignature(com.oracle.svm.graal.meta.SubstrateSignature)

Example 2 with SubstrateSignature

use of com.oracle.svm.graal.meta.SubstrateSignature in project graal by oracle.

the class GraalObjectReplacer method createSignature.

private SubstrateSignature createSignature(Signature original) {
    SubstrateSignature sSignature = signatures.get(original);
    if (sSignature == null) {
        sSignature = new SubstrateSignature();
        signatures.put(original, sSignature);
        SubstrateType[] parameterTypes = new SubstrateType[original.getParameterCount(false)];
        for (int index = 0; index < original.getParameterCount(false); index++) {
            parameterTypes[index] = createType(original.getParameterType(index, null));
        }
        /*
             * The links to other meta objects must be set after adding to the signatures to avoid
             * infinite recursion.
             */
        sSignature.setTypes(parameterTypes, createType(original.getReturnType(null)));
    }
    return sSignature;
}
Also used : SubstrateSignature(com.oracle.svm.graal.meta.SubstrateSignature) SubstrateType(com.oracle.svm.graal.meta.SubstrateType)

Aggregations

SubstrateSignature (com.oracle.svm.graal.meta.SubstrateSignature)2 SubstrateType (com.oracle.svm.graal.meta.SubstrateType)2 SubstrateFieldLocationIdentity (com.oracle.svm.core.graal.nodes.SubstrateFieldLocationIdentity)1 SubstrateField (com.oracle.svm.graal.meta.SubstrateField)1 SubstrateMethod (com.oracle.svm.graal.meta.SubstrateMethod)1 FieldLocationIdentity (org.graalvm.compiler.nodes.FieldLocationIdentity)1