All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdk.graal.compiler.debug.DebugDumpHandler Maven / Gradle / Ivy

There is a newer version: 24.1.1
Show newest version
/*
 * Copyright (c) 2012, 2022, 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
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
package jdk.graal.compiler.debug;

import java.io.Closeable;

/**
 * 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 {

    /**
     * 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 object the object to be dumped
     * @param debug the debug context requesting the dump
     * @param forced true if called from {@link DebugContext#forceDump(Object, String, Object...)}
     * @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}
     */
    void dump(Object object, DebugContext debug, boolean forced, String format, Object... arguments);

    /**
     * Flushes and releases resources managed by this dump handler. A subsequent call to
     * {@link #dump} will create and open new resources. That is, this method can be used to reset
     * the handler.
     */
    @Override
    default void close() {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy