public class RemoveUnwindPhase
extends org.graalvm.compiler.phases.Phase
exception handling mechanism
of Substrate VM is capable of jumping
over methods that have no exception handler registered. That saves us from emitting boilerplate
code in every call site in every method that just forwards the exception object from the
WithExceptionNode
to the UnwindNode
.Constructor and Description |
---|
RemoveUnwindPhase() |
Modifier and Type | Method and Description |
---|---|
protected void |
run(org.graalvm.compiler.nodes.StructuredGraph graph) |
protected static void |
walkBack(org.graalvm.compiler.graph.Node n,
org.graalvm.compiler.graph.Node successor,
List<org.graalvm.compiler.nodes.WithExceptionNode> withExceptionNodes,
List<org.graalvm.compiler.nodes.extended.BytecodeExceptionNode> bytecodeExceptionNodes,
org.graalvm.compiler.nodes.ValueNode expectedExceptionNode,
org.graalvm.compiler.nodes.StructuredGraph graph)
We walk back from the
UnwindNode to a WithExceptionNode . |
apply, apply, codeSizeIncrease, contractorName, getName, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevel
protected void run(org.graalvm.compiler.nodes.StructuredGraph graph)
run
in class org.graalvm.compiler.phases.Phase
protected static void walkBack(org.graalvm.compiler.graph.Node n, org.graalvm.compiler.graph.Node successor, List<org.graalvm.compiler.nodes.WithExceptionNode> withExceptionNodes, List<org.graalvm.compiler.nodes.extended.BytecodeExceptionNode> bytecodeExceptionNodes, org.graalvm.compiler.nodes.ValueNode expectedExceptionNode, org.graalvm.compiler.nodes.StructuredGraph graph)
UnwindNode
to a WithExceptionNode
. If the control flow
path only contains nodes white-listed in this method, then we know that we have a node that
just forwards the exception to the UnwindNode
. Such nodes are rewritten to a variant
without an exception edge, i.e., no exception handler entry is created for such invokes.