Search in sources :

Example 1 with BytecodeExceptionNode

use of org.graalvm.compiler.nodes.extended.BytecodeExceptionNode in project graal by oracle.

the class MethodTypeFlowBuilder method registerUsedElements.

public static void registerUsedElements(BigBang bb, StructuredGraph graph, MethodTypeFlow methodFlow) {
    for (Node n : graph.getNodes()) {
        if (n instanceof InstanceOfNode) {
            InstanceOfNode node = (InstanceOfNode) n;
            AnalysisType type = (AnalysisType) node.type().getType();
            type.registerAsInTypeCheck();
        } else if (n instanceof NewInstanceNode) {
            NewInstanceNode node = (NewInstanceNode) n;
            AnalysisType type = (AnalysisType) node.instanceClass();
            type.registerAsAllocated(node);
        } else if (n instanceof NewArrayNode) {
            NewArrayNode node = (NewArrayNode) n;
            AnalysisType type = ((AnalysisType) node.elementType()).getArrayClass();
            type.registerAsAllocated(node);
        } else if (n instanceof NewMultiArrayNode) {
            NewMultiArrayNode node = (NewMultiArrayNode) n;
            AnalysisType type = ((AnalysisType) node.type());
            for (int i = 0; i < node.dimensionCount(); i++) {
                type.registerAsAllocated(node);
                type = type.getComponentType();
            }
        } else if (n instanceof BoxNode) {
            BoxNode node = (BoxNode) n;
            AnalysisType type = (AnalysisType) StampTool.typeOrNull(node);
            type.registerAsAllocated(node);
        } else if (n instanceof LoadFieldNode) {
            LoadFieldNode node = (LoadFieldNode) n;
            AnalysisField field = (AnalysisField) node.field();
            field.registerAsRead(methodFlow);
        } else if (n instanceof StoreFieldNode) {
            StoreFieldNode node = (StoreFieldNode) n;
            AnalysisField field = (AnalysisField) node.field();
            field.registerAsWritten(methodFlow);
        } else if (n instanceof StoreIndexedNode) {
            StoreIndexedNode node = (StoreIndexedNode) n;
            AnalysisType arrayType = (AnalysisType) StampTool.typeOrNull(node.array());
            if (arrayType != null) {
                assert arrayType.isArray();
                arrayType.getComponentType().registerAsInTypeCheck();
            }
        } else if (n instanceof BytecodeExceptionNode) {
            BytecodeExceptionNode node = (BytecodeExceptionNode) n;
            AnalysisType type = bb.getMetaAccess().lookupJavaType(node.getExceptionClass());
            type.registerAsInHeap();
        } else if (n instanceof ConstantNode) {
            ConstantNode cn = (ConstantNode) n;
            if (cn.hasUsages() && cn.asJavaConstant().getJavaKind() == JavaKind.Object && cn.asJavaConstant().isNonNull()) {
                assert StampTool.isExactType(cn);
                AnalysisType type = (AnalysisType) StampTool.typeOrNull(cn);
                type.registerAsInHeap();
            }
        } else if (n instanceof ForeignCallNode) {
            ForeignCallNode node = (ForeignCallNode) n;
            registerForeignCall(bb, node.getDescriptor());
        } else if (n instanceof UnaryMathIntrinsicNode) {
            UnaryMathIntrinsicNode node = (UnaryMathIntrinsicNode) n;
            registerForeignCall(bb, node.getOperation().foreignCallDescriptor);
        } else if (n instanceof BinaryMathIntrinsicNode) {
            BinaryMathIntrinsicNode node = (BinaryMathIntrinsicNode) n;
            registerForeignCall(bb, node.getOperation().foreignCallDescriptor);
        }
    }
}
Also used : AnalysisType(com.oracle.graal.pointsto.meta.AnalysisType) StoreIndexedNode(org.graalvm.compiler.nodes.java.StoreIndexedNode) StoreFieldNode(org.graalvm.compiler.nodes.java.StoreFieldNode) NewInstanceNode(org.graalvm.compiler.nodes.java.NewInstanceNode) DynamicNewInstanceNode(org.graalvm.compiler.nodes.java.DynamicNewInstanceNode) DynamicNewArrayNode(org.graalvm.compiler.nodes.java.DynamicNewArrayNode) NewArrayNode(org.graalvm.compiler.nodes.java.NewArrayNode) UnaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode) RawLoadNode(org.graalvm.compiler.nodes.extended.RawLoadNode) BeginNode(org.graalvm.compiler.nodes.BeginNode) MethodCallTargetNode(org.graalvm.compiler.nodes.java.MethodCallTargetNode) LoopBeginNode(org.graalvm.compiler.nodes.LoopBeginNode) WordCastNode(org.graalvm.compiler.word.WordCastNode) DynamicNewArrayNode(org.graalvm.compiler.nodes.java.DynamicNewArrayNode) ObjectEqualsNode(org.graalvm.compiler.nodes.calc.ObjectEqualsNode) BasicObjectCloneNode(org.graalvm.compiler.replacements.nodes.BasicObjectCloneNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) InvokeWithExceptionNode(org.graalvm.compiler.nodes.InvokeWithExceptionNode) AtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode) ConvertUnknownValueNode(com.oracle.graal.pointsto.nodes.ConvertUnknownValueNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) AbstractEndNode(org.graalvm.compiler.nodes.AbstractEndNode) AnalysisUnsafePartitionLoadNode(com.oracle.graal.pointsto.nodes.AnalysisUnsafePartitionLoadNode) LoopEndNode(org.graalvm.compiler.nodes.LoopEndNode) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) NewInstanceNode(org.graalvm.compiler.nodes.java.NewInstanceNode) PhiNode(org.graalvm.compiler.nodes.PhiNode) AnalysisArraysCopyOfNode(com.oracle.graal.pointsto.nodes.AnalysisArraysCopyOfNode) DynamicNewInstanceNode(org.graalvm.compiler.nodes.java.DynamicNewInstanceNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) NewMultiArrayNode(org.graalvm.compiler.nodes.java.NewMultiArrayNode) LoadIndexedNode(org.graalvm.compiler.nodes.java.LoadIndexedNode) ReturnNode(org.graalvm.compiler.nodes.ReturnNode) BoxNode(org.graalvm.compiler.nodes.extended.BoxNode) BinaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode) IfNode(org.graalvm.compiler.nodes.IfNode) RawStoreNode(org.graalvm.compiler.nodes.extended.RawStoreNode) FixedGuardNode(org.graalvm.compiler.nodes.FixedGuardNode) LogicNode(org.graalvm.compiler.nodes.LogicNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) IsNullNode(org.graalvm.compiler.nodes.calc.IsNullNode) NewArrayNode(org.graalvm.compiler.nodes.java.NewArrayNode) UnsafeCompareAndSwapNode(org.graalvm.compiler.nodes.java.UnsafeCompareAndSwapNode) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) ExceptionObjectNode(org.graalvm.compiler.nodes.java.ExceptionObjectNode) InstanceOfNode(org.graalvm.compiler.nodes.java.InstanceOfNode) BasicArrayCopyNode(org.graalvm.compiler.replacements.nodes.BasicArrayCopyNode) InvokeNode(org.graalvm.compiler.nodes.InvokeNode) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) UnaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode) StoreIndexedNode(org.graalvm.compiler.nodes.java.StoreIndexedNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) GetClassNode(org.graalvm.compiler.nodes.extended.GetClassNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) StoreFieldNode(org.graalvm.compiler.nodes.java.StoreFieldNode) Node(org.graalvm.compiler.graph.Node) EndNode(org.graalvm.compiler.nodes.EndNode) AnalysisUnsafePartitionStoreNode(com.oracle.graal.pointsto.nodes.AnalysisUnsafePartitionStoreNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) BoxNode(org.graalvm.compiler.nodes.extended.BoxNode) AnalysisField(com.oracle.graal.pointsto.meta.AnalysisField) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) BinaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) NewMultiArrayNode(org.graalvm.compiler.nodes.java.NewMultiArrayNode) InstanceOfNode(org.graalvm.compiler.nodes.java.InstanceOfNode)

Example 2 with BytecodeExceptionNode

use of org.graalvm.compiler.nodes.extended.BytecodeExceptionNode in project graal by oracle.

the class BytecodeParser method emitExplicitBoundsCheck.

protected void emitExplicitBoundsCheck(ValueNode index, ValueNode length) {
    AbstractBeginNode trueSucc = graph.add(new BeginNode());
    BytecodeExceptionNode exception = graph.add(new BytecodeExceptionNode(metaAccess, ArrayIndexOutOfBoundsException.class, index));
    append(new IfNode(genUnique(IntegerBelowNode.create(constantReflection, metaAccess, options, null, index, length, NodeView.DEFAULT)), trueSucc, exception, FAST_PATH_PROBABILITY));
    lastInstr = trueSucc;
    exception.setStateAfter(createFrameState(bci(), exception));
    exception.setNext(handleException(exception, bci(), false));
}
Also used : BeginNode(org.graalvm.compiler.nodes.BeginNode) LoopBeginNode(org.graalvm.compiler.nodes.LoopBeginNode) KillingBeginNode(org.graalvm.compiler.nodes.KillingBeginNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) IfNode(org.graalvm.compiler.nodes.IfNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode)

Example 3 with BytecodeExceptionNode

use of org.graalvm.compiler.nodes.extended.BytecodeExceptionNode in project graal by oracle.

the class BytecodeParser method emitExplicitNullCheck.

protected ValueNode emitExplicitNullCheck(ValueNode receiver) {
    if (StampTool.isPointerNonNull(receiver.stamp(NodeView.DEFAULT))) {
        return receiver;
    }
    BytecodeExceptionNode exception = graph.add(new BytecodeExceptionNode(metaAccess, NullPointerException.class));
    AbstractBeginNode falseSucc = graph.add(new BeginNode());
    ValueNode nonNullReceiver = graph.addOrUniqueWithInputs(PiNode.create(receiver, objectNonNull(), falseSucc));
    append(new IfNode(graph.addOrUniqueWithInputs(IsNullNode.create(receiver)), exception, falseSucc, SLOW_PATH_PROBABILITY));
    lastInstr = falseSucc;
    exception.setStateAfter(createFrameState(bci(), exception));
    exception.setNext(handleException(exception, bci(), false));
    EXPLICIT_EXCEPTIONS.increment(debug);
    return nonNullReceiver;
}
Also used : BeginNode(org.graalvm.compiler.nodes.BeginNode) LoopBeginNode(org.graalvm.compiler.nodes.LoopBeginNode) KillingBeginNode(org.graalvm.compiler.nodes.KillingBeginNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) IfNode(org.graalvm.compiler.nodes.IfNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode)

Example 4 with BytecodeExceptionNode

use of org.graalvm.compiler.nodes.extended.BytecodeExceptionNode in project graal by oracle.

the class DefaultHotSpotLoweringProvider method lower.

@Override
public void lower(Node n, LoweringTool tool) {
    StructuredGraph graph = (StructuredGraph) n.graph();
    if (n instanceof Invoke) {
        lowerInvoke((Invoke) n, tool, graph);
    } else if (n instanceof LoadMethodNode) {
        lowerLoadMethodNode((LoadMethodNode) n);
    } else if (n instanceof GetClassNode) {
        lowerGetClassNode((GetClassNode) n, tool, graph);
    } else if (n instanceof StoreHubNode) {
        lowerStoreHubNode((StoreHubNode) n, graph);
    } else if (n instanceof OSRStartNode) {
        lowerOSRStartNode((OSRStartNode) n);
    } else if (n instanceof BytecodeExceptionNode) {
        lowerBytecodeExceptionNode((BytecodeExceptionNode) n);
    } else if (n instanceof InstanceOfNode) {
        InstanceOfNode instanceOfNode = (InstanceOfNode) n;
        if (graph.getGuardsStage().areDeoptsFixed()) {
            instanceofSnippets.lower(instanceOfNode, tool);
        } else {
            if (instanceOfNode.allowsNull()) {
                ValueNode object = instanceOfNode.getValue();
                LogicNode newTypeCheck = graph.addOrUniqueWithInputs(InstanceOfNode.create(instanceOfNode.type(), object, instanceOfNode.profile(), instanceOfNode.getAnchor()));
                LogicNode newNode = LogicNode.or(graph.unique(IsNullNode.create(object)), newTypeCheck, GraalDirectives.UNLIKELY_PROBABILITY);
                instanceOfNode.replaceAndDelete(newNode);
            }
        }
    } else if (n instanceof InstanceOfDynamicNode) {
        InstanceOfDynamicNode instanceOfDynamicNode = (InstanceOfDynamicNode) n;
        if (graph.getGuardsStage().areDeoptsFixed()) {
            instanceofSnippets.lower(instanceOfDynamicNode, tool);
        } else {
            ValueNode mirror = instanceOfDynamicNode.getMirrorOrHub();
            if (mirror.stamp(NodeView.DEFAULT).getStackKind() == JavaKind.Object) {
                ClassGetHubNode classGetHub = graph.unique(new ClassGetHubNode(mirror));
                instanceOfDynamicNode.setMirror(classGetHub);
            }
            if (instanceOfDynamicNode.allowsNull()) {
                ValueNode object = instanceOfDynamicNode.getObject();
                LogicNode newTypeCheck = graph.addOrUniqueWithInputs(InstanceOfDynamicNode.create(graph.getAssumptions(), tool.getConstantReflection(), instanceOfDynamicNode.getMirrorOrHub(), object, false));
                LogicNode newNode = LogicNode.or(graph.unique(IsNullNode.create(object)), newTypeCheck, GraalDirectives.UNLIKELY_PROBABILITY);
                instanceOfDynamicNode.replaceAndDelete(newNode);
            }
        }
    } else if (n instanceof ClassIsAssignableFromNode) {
        if (graph.getGuardsStage().areDeoptsFixed()) {
            instanceofSnippets.lower((ClassIsAssignableFromNode) n, tool);
        }
    } else if (n instanceof NewInstanceNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower((NewInstanceNode) n, registers, tool);
        }
    } else if (n instanceof DynamicNewInstanceNode) {
        DynamicNewInstanceNode newInstanceNode = (DynamicNewInstanceNode) n;
        if (newInstanceNode.getClassClass() == null) {
            JavaConstant classClassMirror = constantReflection.forObject(Class.class);
            ConstantNode classClass = ConstantNode.forConstant(classClassMirror, tool.getMetaAccess(), graph);
            newInstanceNode.setClassClass(classClass);
        }
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower(newInstanceNode, registers, tool);
        }
    } else if (n instanceof NewArrayNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower((NewArrayNode) n, registers, tool);
        }
    } else if (n instanceof DynamicNewArrayNode) {
        DynamicNewArrayNode dynamicNewArrayNode = (DynamicNewArrayNode) n;
        if (dynamicNewArrayNode.getVoidClass() == null) {
            JavaConstant voidClassMirror = constantReflection.forObject(void.class);
            ConstantNode voidClass = ConstantNode.forConstant(voidClassMirror, tool.getMetaAccess(), graph);
            dynamicNewArrayNode.setVoidClass(voidClass);
        }
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower(dynamicNewArrayNode, registers, tool);
        }
    } else if (n instanceof VerifyHeapNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower((VerifyHeapNode) n, registers, tool);
        }
    } else if (n instanceof RawMonitorEnterNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            monitorSnippets.lower((RawMonitorEnterNode) n, registers, tool);
        }
    } else if (n instanceof MonitorExitNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            monitorSnippets.lower((MonitorExitNode) n, registers, tool);
        }
    } else if (n instanceof ArrayCopyNode) {
        arraycopySnippets.lower((ArrayCopyNode) n, tool);
    } else if (n instanceof ArrayCopyWithSlowPathNode) {
        arraycopySnippets.lower((ArrayCopyWithSlowPathNode) n, tool);
    } else if (n instanceof G1PreWriteBarrier) {
        writeBarrierSnippets.lower((G1PreWriteBarrier) n, registers, tool);
    } else if (n instanceof G1PostWriteBarrier) {
        writeBarrierSnippets.lower((G1PostWriteBarrier) n, registers, tool);
    } else if (n instanceof G1ReferentFieldReadBarrier) {
        writeBarrierSnippets.lower((G1ReferentFieldReadBarrier) n, registers, tool);
    } else if (n instanceof SerialWriteBarrier) {
        writeBarrierSnippets.lower((SerialWriteBarrier) n, tool);
    } else if (n instanceof SerialArrayRangeWriteBarrier) {
        writeBarrierSnippets.lower((SerialArrayRangeWriteBarrier) n, tool);
    } else if (n instanceof G1ArrayRangePreWriteBarrier) {
        writeBarrierSnippets.lower((G1ArrayRangePreWriteBarrier) n, registers, tool);
    } else if (n instanceof G1ArrayRangePostWriteBarrier) {
        writeBarrierSnippets.lower((G1ArrayRangePostWriteBarrier) n, registers, tool);
    } else if (n instanceof NewMultiArrayNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            newObjectSnippets.lower((NewMultiArrayNode) n, tool);
        }
    } else if (n instanceof LoadExceptionObjectNode) {
        exceptionObjectSnippets.lower((LoadExceptionObjectNode) n, registers, tool);
    } else if (n instanceof AssertionNode) {
        assertionSnippets.lower((AssertionNode) n, tool);
    } else if (n instanceof StringToBytesNode) {
        if (graph.getGuardsStage().areDeoptsFixed()) {
            stringToBytesSnippets.lower((StringToBytesNode) n, tool);
        }
    } else if (n instanceof IntegerDivRemNode) {
    // Nothing to do for division nodes. The HotSpot signal handler catches divisions by
    // zero and the MIN_VALUE / -1 cases.
    } else if (n instanceof AbstractDeoptimizeNode || n instanceof UnwindNode || n instanceof RemNode || n instanceof SafepointNode) {
    /* No lowering, we generate LIR directly for these nodes. */
    } else if (n instanceof ClassGetHubNode) {
        lowerClassGetHubNode((ClassGetHubNode) n, tool);
    } else if (n instanceof HubGetClassNode) {
        lowerHubGetClassNode((HubGetClassNode) n, tool);
    } else if (n instanceof KlassLayoutHelperNode) {
        lowerKlassLayoutHelperNode((KlassLayoutHelperNode) n, tool);
    } else if (n instanceof ComputeObjectAddressNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            lowerComputeObjectAddressNode((ComputeObjectAddressNode) n);
        }
    } else if (n instanceof IdentityHashCodeNode) {
        hashCodeSnippets.lower((IdentityHashCodeNode) n, tool);
    } else if (n instanceof ResolveDynamicConstantNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            resolveConstantSnippets.lower((ResolveDynamicConstantNode) n, tool);
        }
    } else if (n instanceof ResolveConstantNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            resolveConstantSnippets.lower((ResolveConstantNode) n, tool);
        }
    } else if (n instanceof ResolveMethodAndLoadCountersNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            resolveConstantSnippets.lower((ResolveMethodAndLoadCountersNode) n, tool);
        }
    } else if (n instanceof InitializeKlassNode) {
        if (graph.getGuardsStage().areFrameStatesAtDeopts()) {
            resolveConstantSnippets.lower((InitializeKlassNode) n, tool);
        }
    } else if (n instanceof ProfileNode) {
        profileSnippets.lower((ProfileNode) n, tool);
    } else {
        super.lower(n, tool);
    }
}
Also used : ClassIsAssignableFromNode(org.graalvm.compiler.nodes.java.ClassIsAssignableFromNode) SafepointNode(org.graalvm.compiler.nodes.SafepointNode) HubGetClassNode(org.graalvm.compiler.hotspot.replacements.HubGetClassNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) MonitorExitNode(org.graalvm.compiler.nodes.java.MonitorExitNode) ResolveConstantNode(org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) ResolveDynamicConstantNode(org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode) ResolveConstantNode(org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode) KlassLayoutHelperNode(org.graalvm.compiler.hotspot.replacements.KlassLayoutHelperNode) ComputeObjectAddressNode(org.graalvm.compiler.hotspot.nodes.ComputeObjectAddressNode) ResolveDynamicConstantNode(org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode) IntegerDivRemNode(org.graalvm.compiler.nodes.calc.IntegerDivRemNode) RemNode(org.graalvm.compiler.nodes.calc.RemNode) DynamicNewArrayNode(org.graalvm.compiler.nodes.java.DynamicNewArrayNode) NewArrayNode(org.graalvm.compiler.nodes.java.NewArrayNode) HubGetClassNode(org.graalvm.compiler.hotspot.replacements.HubGetClassNode) GetClassNode(org.graalvm.compiler.nodes.extended.GetClassNode) SerialWriteBarrier(org.graalvm.compiler.hotspot.nodes.SerialWriteBarrier) LoadMethodNode(org.graalvm.compiler.nodes.extended.LoadMethodNode) AbstractDeoptimizeNode(org.graalvm.compiler.nodes.AbstractDeoptimizeNode) InstanceOfDynamicNode(org.graalvm.compiler.nodes.java.InstanceOfDynamicNode) OSRStartNode(org.graalvm.compiler.nodes.extended.OSRStartNode) ResolveMethodAndLoadCountersNode(org.graalvm.compiler.hotspot.nodes.aot.ResolveMethodAndLoadCountersNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) LogicNode(org.graalvm.compiler.nodes.LogicNode) G1PostWriteBarrier(org.graalvm.compiler.hotspot.nodes.G1PostWriteBarrier) InstanceOfNode(org.graalvm.compiler.nodes.java.InstanceOfNode) NewInstanceNode(org.graalvm.compiler.nodes.java.NewInstanceNode) DynamicNewInstanceNode(org.graalvm.compiler.nodes.java.DynamicNewInstanceNode) StoreHubNode(org.graalvm.compiler.nodes.extended.StoreHubNode) G1ArrayRangePreWriteBarrier(org.graalvm.compiler.hotspot.nodes.G1ArrayRangePreWriteBarrier) JavaConstant(jdk.vm.ci.meta.JavaConstant) Invoke(org.graalvm.compiler.nodes.Invoke) AssertionNode(org.graalvm.compiler.replacements.nodes.AssertionNode) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) ProfileNode(org.graalvm.compiler.hotspot.nodes.profiling.ProfileNode) StringToBytesNode(org.graalvm.compiler.nodes.debug.StringToBytesNode) ClassGetHubNode(org.graalvm.compiler.hotspot.replacements.ClassGetHubNode) UnwindNode(org.graalvm.compiler.nodes.UnwindNode) SerialArrayRangeWriteBarrier(org.graalvm.compiler.hotspot.nodes.SerialArrayRangeWriteBarrier) IntegerDivRemNode(org.graalvm.compiler.nodes.calc.IntegerDivRemNode) ArrayCopyNode(org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyNode) G1ArrayRangePostWriteBarrier(org.graalvm.compiler.hotspot.nodes.G1ArrayRangePostWriteBarrier) DynamicNewInstanceNode(org.graalvm.compiler.nodes.java.DynamicNewInstanceNode) G1PreWriteBarrier(org.graalvm.compiler.hotspot.nodes.G1PreWriteBarrier) RawMonitorEnterNode(org.graalvm.compiler.nodes.java.RawMonitorEnterNode) G1ReferentFieldReadBarrier(org.graalvm.compiler.hotspot.nodes.G1ReferentFieldReadBarrier) VerifyHeapNode(org.graalvm.compiler.nodes.debug.VerifyHeapNode) LoadExceptionObjectNode(org.graalvm.compiler.nodes.java.LoadExceptionObjectNode) ArrayCopyWithSlowPathNode(org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyWithSlowPathNode) IdentityHashCodeNode(org.graalvm.compiler.hotspot.replacements.IdentityHashCodeNode) NewMultiArrayNode(org.graalvm.compiler.nodes.java.NewMultiArrayNode) InitializeKlassNode(org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode) DynamicNewArrayNode(org.graalvm.compiler.nodes.java.DynamicNewArrayNode)

Example 5 with BytecodeExceptionNode

use of org.graalvm.compiler.nodes.extended.BytecodeExceptionNode in project graal by oracle.

the class BytecodeExceptionTest method throwBytecodeException.

protected boolean throwBytecodeException(GraphBuilderContext b, Class<? extends Throwable> exception, ValueNode... arguments) {
    BytecodeExceptionNode exceptionNode = b.add(new BytecodeExceptionNode(b.getMetaAccess(), exception, arguments));
    b.add(new UnwindNode(exceptionNode));
    return true;
}
Also used : BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) UnwindNode(org.graalvm.compiler.nodes.UnwindNode)

Aggregations

BytecodeExceptionNode (org.graalvm.compiler.nodes.extended.BytecodeExceptionNode)5 BeginNode (org.graalvm.compiler.nodes.BeginNode)3 IfNode (org.graalvm.compiler.nodes.IfNode)3 LoopBeginNode (org.graalvm.compiler.nodes.LoopBeginNode)3 ValueNode (org.graalvm.compiler.nodes.ValueNode)3 AbstractBeginNode (org.graalvm.compiler.nodes.AbstractBeginNode)2 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)2 KillingBeginNode (org.graalvm.compiler.nodes.KillingBeginNode)2 LogicNode (org.graalvm.compiler.nodes.LogicNode)2 UnwindNode (org.graalvm.compiler.nodes.UnwindNode)2 GetClassNode (org.graalvm.compiler.nodes.extended.GetClassNode)2 DynamicNewArrayNode (org.graalvm.compiler.nodes.java.DynamicNewArrayNode)2 DynamicNewInstanceNode (org.graalvm.compiler.nodes.java.DynamicNewInstanceNode)2 AnalysisField (com.oracle.graal.pointsto.meta.AnalysisField)1 AnalysisType (com.oracle.graal.pointsto.meta.AnalysisType)1 AnalysisArraysCopyOfNode (com.oracle.graal.pointsto.nodes.AnalysisArraysCopyOfNode)1 AnalysisUnsafePartitionLoadNode (com.oracle.graal.pointsto.nodes.AnalysisUnsafePartitionLoadNode)1 AnalysisUnsafePartitionStoreNode (com.oracle.graal.pointsto.nodes.AnalysisUnsafePartitionStoreNode)1 ConvertUnknownValueNode (com.oracle.graal.pointsto.nodes.ConvertUnknownValueNode)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1