Search in sources :

Example 46 with ParameterNode

use of org.graalvm.compiler.nodes.ParameterNode 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

ParameterNode (org.graalvm.compiler.nodes.ParameterNode)46 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)19 ValueNode (org.graalvm.compiler.nodes.ValueNode)19 Node (org.graalvm.compiler.graph.Node)13 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)13 ReturnNode (org.graalvm.compiler.nodes.ReturnNode)13 Test (org.junit.Test)10 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)9 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)8 DebugContext (org.graalvm.compiler.debug.DebugContext)7 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)7 FrameState (org.graalvm.compiler.nodes.FrameState)7 InvokeWithExceptionNode (org.graalvm.compiler.nodes.InvokeWithExceptionNode)7 FixedNode (org.graalvm.compiler.nodes.FixedNode)6 CanonicalizerPhase (org.graalvm.compiler.phases.common.CanonicalizerPhase)6 AbstractMergeNode (org.graalvm.compiler.nodes.AbstractMergeNode)5 InvokeNode (org.graalvm.compiler.nodes.InvokeNode)5 PhiNode (org.graalvm.compiler.nodes.PhiNode)5 ArrayList (java.util.ArrayList)4 JavaConstant (jdk.vm.ci.meta.JavaConstant)4