Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/hotspot/share/opto/idealGraphPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ void IdealGraphPrinter::set_traverse_outs(bool b) {
_traverse_outs = b;
}

const Parse* IdealGraphPrinter::parse() {
return _parse;
}

void IdealGraphPrinter::set_parse(const Parse* parse) {
_parse = parse;
}

void IdealGraphPrinter::visit_node(Node* n, bool edges) {

if (edges) {
Expand Down Expand Up @@ -996,6 +1004,17 @@ void IdealGraphPrinter::print(const char* name, Node* node, GrowableArray<const

head(PROPERTIES_ELEMENT);
print_stack(fr, nullptr);
if (_parse != nullptr) {
if (_parse->map() == nullptr) {
print_prop("map", "-");
} else {
print_prop("map", _parse->map()->_idx);
}
print_prop("block", _parse->block()->rpo());
stringStream shortStr;
_parse->flow()->method()->print_short_name(&shortStr);
print_prop("method", shortStr.freeze());
}
tail(PROPERTIES_ELEMENT);

head(NODES_ELEMENT);
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/opto/idealGraphPrinter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Node;
class InlineTree;
class ciMethod;
class JVMState;
class Parse;

class IdealGraphPrinter : public CHeapObj<mtCompiler> {
private:
Expand Down Expand Up @@ -115,6 +116,7 @@ class IdealGraphPrinter : public CHeapObj<mtCompiler> {
Compile *C;
double _max_freq;
bool _append;
const Parse* _parse;

// Walk the native stack and print relevant C2 frames as IGV properties (if
// graph_name == nullptr) or the graph name based on the highest C2 frame (if
Expand Down Expand Up @@ -156,6 +158,8 @@ class IdealGraphPrinter : public CHeapObj<mtCompiler> {

bool traverse_outs();
void set_traverse_outs(bool b);
const Parse* parse();
void set_parse(const Parse* parser);
void print_inlining();
void begin_method();
void end_method();
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/parse2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2779,11 +2779,13 @@ void Parse::do_one_bytecode() {
if (C->should_print_igv(perBytecode)) {
IdealGraphPrinter* printer = C->igv_printer();
char buffer[256];
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s, map: %d", bci(), Bytecodes::name(bc()), map() == nullptr ? -1 : map()->_idx);
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
bool old = printer->traverse_outs();
printer->set_traverse_outs(true);
printer->set_parse(this);
printer->print_graph(buffer);
printer->set_traverse_outs(old);
printer->set_parse(nullptr);
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
Expand Down Expand Up @@ -29,6 +29,8 @@
import com.sun.hotspot.igv.data.services.GraphViewer;
import com.sun.hotspot.igv.util.PropertiesSheet;
import com.sun.hotspot.igv.util.StringUtils;
import com.sun.hotspot.igv.view.EditorTopComponent;

import java.awt.Image;
import javax.swing.Action;
import org.openide.actions.OpenAction;
Expand Down Expand Up @@ -86,7 +88,7 @@ public String getHtmlDisplayName() {

@Override
public String getDisplayName() {
return graph.getDisplayName();
return EditorTopComponent.getGraphDisplayName(graph);
}

private GraphNode(InputGraph graph, InstanceContent content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,8 @@ public String getName() {

@Override
public String getDisplayName() {
if (isDiffGraph) {
return firstGraph.getDisplayName() + " Δ " + secondGraph.getDisplayName();
} else {
return getIndex()+1 + ". " + getName();
}
assert false : "Use EditorTopComponent::getGraphDisplayName() instead";
return "";
}

public int getIndex() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2025, 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
Expand Down Expand Up @@ -46,6 +46,8 @@ public static class DefaultView {
public static final String NODE_SHORT_TEXT_DEFAULT = "[idx] [name]";
public static final String NODE_TINY_TEXT = "nodeTinyText";
public static final String NODE_TINY_TEXT_DEFAULT = "[idx]";
public static final String GRAPH_NAME_SUFFIX = "graphNameSuffix";
public static final String GRAPH_NAME_SUFFIX_DEFAULT = "(map: [map], block #[block] at [method])";
public static final String DEFAULT_VIEW = "defaultView";
public static final int DEFAULT_VIEW_DEFAULT = DefaultView.SEA_OF_NODES;
public static final String PORT = "port";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="29" max="32767" attributes="0"/>
<EmptySpace pref="15" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand All @@ -47,14 +47,16 @@
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="nodeShortTextField" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="470" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="663" max="32767" attributes="0"/>
<Component id="portSpinner" alignment="0" max="32767" attributes="0"/>
<Component id="nodeTinyTextField" alignment="0" max="32767" attributes="0"/>
<Component id="defaultViewComboBox" alignment="0" max="32767" attributes="0"/>
<Component id="graphNameSuffixField" alignment="0" max="32767" attributes="0"/>
<Component id="nodeTinyTextField" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
Expand All @@ -70,24 +72,30 @@
</Group>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="nodeShortTextField" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="27" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
<Component id="nodeTinyTextField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="defaultViewComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="graphNameSuffixField" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="27" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="portSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="defaultViewComboBox" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="portSpinner" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -133,9 +141,6 @@
</Component>
<Component class="javax.swing.JTextField" name="nodeShortTextField">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Single-line format string for nodes in edge tooltips, slot tooltips, and node search bar. Properties are specified with brackets (example: &quot;[idx]&quot;)."/>
</Properties>
<AuxValues>
Expand All @@ -149,9 +154,6 @@
</Component>
<Component class="javax.swing.JTextField" name="nodeTinyTextField">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Single-line format string for node input lists. Properties are specified with brackets (example: &quot;[idx]&quot;)."/>
</Properties>
<AuxValues>
Expand All @@ -173,6 +175,19 @@
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="graphNameSuffixField">
<Properties>
<Property name="toolTipText" type="java.lang.String" value="Single-line format string for node input lists. Properties are specified with brackets (example: &quot;[method]&quot;)."/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="ViewPanel_graphNameSuffixField"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="Graph Name Suffix"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
Expand Down
Loading