Search in sources :

Example 21 with AnalysisField

use of com.oracle.graal.pointsto.meta.AnalysisField in project graal by oracle.

the class BigBang method addSystemStaticField.

@SuppressWarnings("try")
public AnalysisType addSystemStaticField(Class<?> clazz, String fieldName) {
    addSystemClass(clazz, false, false);
    Field reflectField;
    try {
        try (Indent indent = debug.logAndIndent("add system static field %s in class %s", fieldName, clazz.getName())) {
            reflectField = clazz.getField(fieldName);
            AnalysisField field = metaAccess.lookupJavaField(reflectField);
            field.registerAsAccessed();
            TypeFlow<?> fieldFlow = field.getType().getTypeFlow(this, true);
            fieldFlow.addUse(this, field.getStaticFieldFlow());
            return field.getType();
        }
    } catch (NoSuchFieldException e) {
        throw shouldNotReachHere("field not found: " + fieldName);
    }
}
Also used : AnalysisField(com.oracle.graal.pointsto.meta.AnalysisField) Field(java.lang.reflect.Field) Indent(org.graalvm.compiler.debug.Indent) AnalysisField(com.oracle.graal.pointsto.meta.AnalysisField)

Aggregations

AnalysisField (com.oracle.graal.pointsto.meta.AnalysisField)21 AnalysisType (com.oracle.graal.pointsto.meta.AnalysisType)9 Indent (org.graalvm.compiler.debug.Indent)4 FieldTypeFlow (com.oracle.graal.pointsto.flow.FieldTypeFlow)3 AnalysisMethod (com.oracle.graal.pointsto.meta.AnalysisMethod)3 SubstrateField (com.oracle.svm.graal.meta.SubstrateField)3 BigBang (com.oracle.graal.pointsto.BigBang)2 HostedField (com.oracle.svm.hosted.meta.HostedField)2 ComputedValueField (com.oracle.svm.hosted.substitute.ComputedValueField)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ValueNode (org.graalvm.compiler.nodes.ValueNode)2 LoadFieldNode (org.graalvm.compiler.nodes.java.LoadFieldNode)2 UnsupportedFeatureException (com.oracle.graal.pointsto.constraints.UnsupportedFeatureException)1 ActualReturnTypeFlow (com.oracle.graal.pointsto.flow.ActualReturnTypeFlow)1 AllInstantiatedTypeFlow (com.oracle.graal.pointsto.flow.AllInstantiatedTypeFlow)1 AllSynchronizedTypeFlow (com.oracle.graal.pointsto.flow.AllSynchronizedTypeFlow)1 ArrayElementsTypeFlow (com.oracle.graal.pointsto.flow.ArrayElementsTypeFlow)1 CloneTypeFlow (com.oracle.graal.pointsto.flow.CloneTypeFlow)1 DynamicNewInstanceTypeFlow (com.oracle.graal.pointsto.flow.DynamicNewInstanceTypeFlow)1