src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58299 6df94ce3ab2f
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     1
/*
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
     2
 * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     4
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     8
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    13
 * accompanied this code).
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    14
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    18
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    21
 * questions.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    22
 */
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    23
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    24
/**
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    25
 * Send your graphs to <b>IGV</b> via a socket or a file. This package allows one to easily encode
48861
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    26
 * any graph-like data structure and send it for visualization to <em>OracleLab's Ideal Graph
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    27
 * Visualizer</em> tool. Assuming you already have your own data structure that contains
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    28
 * <b>nodes</b> and <b>edges</b> among them, creating a {@link org.graalvm.graphio.GraphOutput}
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    29
 * specialized for your data is a matter of implementing a single interface:
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    30
 *
48861
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    31
 * {@link org.graalvm.graphio.GraphJavadocSnippets#acmeGraphStructure}
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    32
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    33
 * The {@link org.graalvm.graphio.GraphStructure} interface defines the set of operations that are
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    34
 * needed by the <em>graph protocol</em> to encode a graph into the <b>IGV</b> expected format. The
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    35
 * graph structure is implemented as a so called
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    36
 * <a href="http://wiki.apidesign.org/wiki/Singletonizer">singletonizer</a> API pattern: there is no
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    37
 * need to change your data structures or implement some special interfaces - everything needed is
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    38
 * provided by implementing the {@link org.graalvm.graphio.GraphStructure} operations.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    39
 * <p>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    40
 * The next step is to turn this graph structure into an instance of
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    41
 * {@link org.graalvm.graphio.GraphOutput}. To do so use the associated
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    42
 * {@link org.graalvm.graphio.GraphOutput.Builder builder} just like shown in the following method:
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    43
 *
48861
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    44
 * {@link org.graalvm.graphio.GraphJavadocSnippets#buildOutput}
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    45
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    46
 * Now you are ready to dump your graph into <b>IGV</b>. Where to obtain the right channel? One
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    47
 * option is to create a {@link java.nio.channels.FileChannel} and dump the data into a file
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    48
 * (preferrably with <code>.bgv</code> extension). The other is to open a socket to port
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    49
 * <code>4445</code> (the default port <b>IGV</b> listens to) and dump the data there. Here is an
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    50
 * example:
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    51
 *
48861
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    52
 * {@link org.graalvm.graphio.GraphJavadocSnippets#dump}
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    53
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    54
 * Call the {@code dump} method with pointer to file {@code diamond.bgv} and then you can open the
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    55
 * file in <b>IGV</b>. The result will look like this:
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    56
 * <p>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    57
 * <img src="doc-files/diamond.png">
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    58
 * <p>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    59
 * You can verify the behavior directly in the <b>IGV</b> by downloading
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    60
 * <a href="doc-files/diamond.bgv">diamond.bgv</a> file generated from the above diamond structure
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    61
 * graph.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    62
 * <p>
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 52910
diff changeset
    63
 * The primary <b>IGV</b> focus is on graphs used by the compiler. As such they aren't plain graphs,
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 52910
diff changeset
    64
 * but contain various compiler oriented attributes:
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    65
 * <ul>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    66
 * <li>{@linkplain org.graalvm.graphio.GraphBlocks code blocks} information</li>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    67
 * <li>{@linkplain org.graalvm.graphio.GraphElements method and fields} information</li>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    68
 * <li>Advanced support for {@linkplain org.graalvm.graphio.GraphTypes recognizing types}</li>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    69
 * </ul>
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    70
 * all these additional interfaces ({@link org.graalvm.graphio.GraphBlocks},
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    71
 * {@link org.graalvm.graphio.GraphElements} and {@link org.graalvm.graphio.GraphTypes}) are
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    72
 * optional - they don't have to be provided. As such they can be specified via
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    73
 * {@link org.graalvm.graphio.GraphOutput.Builder} instance methods, which may, but need not be
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    74
 * called at all. Here is an example:
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    75
 *
48861
47f19ff9903c 8194819: Update Graal
iveresov
parents: 47798
diff changeset
    76
 * {@link org.graalvm.graphio.GraphJavadocSnippets#buildAll}
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    77
 *
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    78
 * All these interfaces follow the
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    79
 * <a href="http://wiki.apidesign.org/wiki/Singletonizer">singletonizer</a> API pattern again - e.g.
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    80
 * no need to change your existing data structures, just implement the operations provided by the
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    81
 * interfaces you pass into the builder. By combining these interfaces together you can get as rich,
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 52910
diff changeset
    82
 * colorful, source linked graphs as the compiler produces to describe its optimizations.
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    83
 */
50858
2d3e99a72541 8205824: Update Graal
never
parents: 48861
diff changeset
    84
2d3e99a72541 8205824: Update Graal
never
parents: 48861
diff changeset
    85
47798
9fe9292f5931 8190710: Update Graal
dlong
parents:
diff changeset
    86
package org.graalvm.graphio;