Search in sources :

Example 1 with ThrowBytecodeExceptionNode

use of com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode in project graal by oracle.

the class RemoveUnwindPhase method convertToThrow.

private static void convertToThrow(BytecodeExceptionNode bytecodeExceptionNode) {
    StructuredGraph graph = bytecodeExceptionNode.graph();
    ThrowBytecodeExceptionNode throwNode = graph.add(new ThrowBytecodeExceptionNode(bytecodeExceptionNode.getExceptionKind(), bytecodeExceptionNode.getArguments()));
    throwNode.setStateBefore(bytecodeExceptionNode.createStateDuring());
    FixedWithNextNode predecessor = (FixedWithNextNode) bytecodeExceptionNode.predecessor();
    GraphUtil.killCFG(bytecodeExceptionNode);
    assert predecessor.next() == null : "must be killed now";
    predecessor.setNext(throwNode);
}
Also used : ThrowBytecodeExceptionNode(com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph)

Example 2 with ThrowBytecodeExceptionNode

use of com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode in project graal by oracle.

the class ImageBuildStatisticsCounterPhase method run.

@Override
protected void run(StructuredGraph graph) {
    for (Node node : graph.getNodes()) {
        if (node instanceof BytecodeExceptionNode || node instanceof ThrowBytecodeExceptionNode) {
            assert node.isAlive() : "ImageBuildStatisticsCounterPhase must be run after proper canonicalization to get the right numbers. Found not alive node: " + node;
            BytecodeExceptionNode.BytecodeExceptionKind bytecodeExceptionKind = node instanceof BytecodeExceptionNode ? ((BytecodeExceptionNode) node).getExceptionKind() : ((ThrowBytecodeExceptionNode) node).getExceptionKind();
            counters().incByteCodeException(bytecodeExceptionKind, location);
        }
    }
}
Also used : ThrowBytecodeExceptionNode(com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode) ThrowBytecodeExceptionNode(com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode) Node(org.graalvm.compiler.graph.Node) ThrowBytecodeExceptionNode(com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode) BytecodeExceptionNode(org.graalvm.compiler.nodes.extended.BytecodeExceptionNode)

Aggregations

ThrowBytecodeExceptionNode (com.oracle.svm.core.graal.nodes.ThrowBytecodeExceptionNode)2 Node (org.graalvm.compiler.graph.Node)1 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)1 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)1 BytecodeExceptionNode (org.graalvm.compiler.nodes.extended.BytecodeExceptionNode)1