Search in sources :

Example 1 with AbstractPointerStamp

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

the class GraphBuilderContext method addNonNullCast.

default ValueNode addNonNullCast(ValueNode value) {
    AbstractPointerStamp valueStamp = (AbstractPointerStamp) value.stamp(NodeView.DEFAULT);
    if (valueStamp.nonNull()) {
        return value;
    } else {
        LogicNode isNull = add(IsNullNode.create(value));
        FixedGuardNode fixedGuard = add(new FixedGuardNode(isNull, DeoptimizationReason.NullCheckException, DeoptimizationAction.None, true));
        Stamp newStamp = valueStamp.improveWith(StampFactory.objectNonNull());
        return add(PiNode.create(value, newStamp, fixedGuard));
    }
}
Also used : FixedGuardNode(org.graalvm.compiler.nodes.FixedGuardNode) ObjectStamp(org.graalvm.compiler.core.common.type.ObjectStamp) AbstractPointerStamp(org.graalvm.compiler.core.common.type.AbstractPointerStamp) Stamp(org.graalvm.compiler.core.common.type.Stamp) AbstractPointerStamp(org.graalvm.compiler.core.common.type.AbstractPointerStamp) LogicNode(org.graalvm.compiler.nodes.LogicNode)

Aggregations

AbstractPointerStamp (org.graalvm.compiler.core.common.type.AbstractPointerStamp)1 ObjectStamp (org.graalvm.compiler.core.common.type.ObjectStamp)1 Stamp (org.graalvm.compiler.core.common.type.Stamp)1 FixedGuardNode (org.graalvm.compiler.nodes.FixedGuardNode)1 LogicNode (org.graalvm.compiler.nodes.LogicNode)1