--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java 2019-03-28 07:37:27.040745214 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java 2019-03-28 07:37:26.652742625 +0100 @@ -26,11 +26,12 @@ import org.graalvm.compiler.nodes.StructuredGraph; +import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaType; + /*** - * This phase serves as a verification, in order to check the graph for certain properties. The - * {@link #verify(StructuredGraph, Object)} method will be used as an assertion, and implements the - * actual check. Instead of returning false, it is also valid to throw an {@link VerificationError} - * in the implemented {@link #verify(StructuredGraph, Object)} method. + * Verifies a {@linkplain #verify graph} or {@linkplain #verifyClass class} against one or more + * invariants. */ public abstract class VerifyPhase extends BasePhase { @@ -55,13 +56,23 @@ @Override protected final void run(StructuredGraph graph, C context) { - assert verify(graph, context); + verify(graph, context); } /** - * Performs the actual verification. + * Checks {@code graph} against some invariants. * * @throws VerificationError if the verification fails */ - protected abstract boolean verify(StructuredGraph graph, C context); + protected abstract void verify(StructuredGraph graph, C context); + + /** + * Checks {@code clazz} against some invariants. + * + * @param clazz the class to verify + * @param metaAccess an object to get a {@link ResolvedJavaType} for {@code clazz} + * @throws VerificationError if the class violates some invariant + */ + public void verifyClass(Class clazz, MetaAccessProvider metaAccess) { + } }