--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java 2017-07-07 09:29:53.000000000 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java 2017-07-07 09:29:52.000000000 -0700 @@ -24,23 +24,34 @@ import java.io.Closeable; -public interface DebugDumpHandler extends Closeable { - - void dump(Object object, String format, Object... arguments); +/** + * Interface implemented by classes that provide an external visualization of selected object types + * such as compiler graphs and nodes. The format and client required to consume the visualizations + * is determined by the implementation. For example, a dumper may convert a compiler node to a human + * readable string and print it to the console. A more sophisticated dumper may serialize a compiler + * graph and send it over the network to a tool (e.g., https://github.com/graalvm/visualizer) that + * can display graphs. + */ +public interface DebugDumpHandler extends Closeable, DebugHandler { /** - * Add arbitrary capability for use by the handler. + * If the type of {@code object} is supported by this dumper, then a representation of + * {@code object} is sent to some consumer in a format determined by this object. * - * @param capability + * @param debug the debug context requesting the dump + * @param object the object to be dumped + * @param format a format string specifying a title that describes the context of the dump + * (e.g., the compiler phase in which request is made) + * @param arguments arguments referenced by the format specifiers in {@code format} */ - default void addCapability(Object capability) { - } + void dump(DebugContext debug, Object object, String format, Object... arguments); /** * Flushes and releases resources managed by this dump handler. A subsequent call to - * {@link #dump(java.lang.Object, java.lang.String, java.lang.Object...)} will create and open - * new resources. That is, this method can be used to reset the handler. + * {@link #dump} will create and open new resources. That is, this method can be used to reset + * the handler. */ @Override - void close(); + default void close() { + } }