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);
}
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);
}
}
}
Aggregations