--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java 2019-01-18 21:34:33.000000000 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java 2019-01-18 21:34:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,9 @@ package org.graalvm.compiler.nodes.graphbuilderconf; +import org.graalvm.compiler.graph.Node.ValueNumberable; +import org.graalvm.compiler.nodes.FixedWithNextNode; +import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.extended.GuardingNode; @@ -210,6 +213,23 @@ } /** + * Allows this plugin to add nodes after the exception object has been loaded in the dispatch + * sequence. Note that a {@link StructuredGraph} is provided to this call instead of a + * {@link GraphBuilderContext} so that the caller has a guarantee that its current control flow + * insertion point is not changed by this call. This means nodes must be added to the graph with + * the appropriate method (e.g., {@link StructuredGraph#unique} for {@link ValueNumberable} + * nodes) and fixed nodes must be manually {@linkplain FixedWithNextNode#setNext added} as + * successors of {@code afterExceptionLoaded}. + * + * @param graph the graph being parsed + * @param afterExceptionLoaded the last fixed node after loading the exception + * @return the last fixed node after instrumentation + */ + default FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded) { + return afterExceptionLoaded; + } + + /** * If the plugin {@link GraphBuilderContext#push pushes} a value with a different * {@link JavaKind} than specified by the bytecode, it must override this method and return * {@code true}. This disables assertion checking for value kinds.