Search in sources :

Example 31 with ObjectStamp

use of org.graalvm.compiler.core.common.type.ObjectStamp in project graal by oracle.

the class NonNullParametersPhase method run.

@Override
protected void run(StructuredGraph graph) {
    Stamp nonNull = StampFactory.objectNonNull();
    for (ParameterNode param : graph.getNodes(ParameterNode.TYPE)) {
        if (param.stamp(NodeView.DEFAULT) instanceof ObjectStamp) {
            ObjectStamp paramStamp = (ObjectStamp) param.stamp(NodeView.DEFAULT);
            param.setStamp(paramStamp.join(nonNull));
        }
    }
}
Also used : ObjectStamp(org.graalvm.compiler.core.common.type.ObjectStamp) Stamp(org.graalvm.compiler.core.common.type.Stamp) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) ObjectStamp(org.graalvm.compiler.core.common.type.ObjectStamp)

Aggregations

ObjectStamp (org.graalvm.compiler.core.common.type.ObjectStamp)31 ValueNode (org.graalvm.compiler.nodes.ValueNode)14 Stamp (org.graalvm.compiler.core.common.type.Stamp)12 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)10 FixedGuardNode (org.graalvm.compiler.nodes.FixedGuardNode)8 Node (org.graalvm.compiler.graph.Node)6 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)6 ParameterNode (org.graalvm.compiler.nodes.ParameterNode)6 PiNode (org.graalvm.compiler.nodes.PiNode)6 TypeReference (org.graalvm.compiler.core.common.type.TypeReference)5 LogicNode (org.graalvm.compiler.nodes.LogicNode)5 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)4 JavaConstant (jdk.vm.ci.meta.JavaConstant)3 JavaType (jdk.vm.ci.meta.JavaType)3 AbstractBeginNode (org.graalvm.compiler.nodes.AbstractBeginNode)3 LoadHubNode (org.graalvm.compiler.nodes.extended.LoadHubNode)3 LoadFieldNode (org.graalvm.compiler.nodes.java.LoadFieldNode)3 MethodCallTargetNode (org.graalvm.compiler.nodes.java.MethodCallTargetNode)3 HotSpotResolvedObjectType (jdk.vm.ci.hotspot.HotSpotResolvedObjectType)2 Constant (jdk.vm.ci.meta.Constant)2