annotate src/share/vm/opto/idealGraphPrinter.hpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents c18cbe5936b8
children 1927db75dd85
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "libadt/dict.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "libadt/vectset.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "utilities/growableArray.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "utilities/ostream.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "utilities/xmlstream.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33
0
a61af66fc99e Initial load
duke
parents:
diff changeset
34 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class Compile;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class PhaseIFG;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 class PhaseChaitin;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 class Matcher;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 class Node;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class InlineTree;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 class ciMethod;
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 class IdealGraphPrinter
a61af66fc99e Initial load
duke
parents:
diff changeset
45 {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 enum State
a61af66fc99e Initial load
duke
parents:
diff changeset
49 {
a61af66fc99e Initial load
duke
parents:
diff changeset
50 Invalid,
a61af66fc99e Initial load
duke
parents:
diff changeset
51 Valid,
a61af66fc99e Initial load
duke
parents:
diff changeset
52 New
a61af66fc99e Initial load
duke
parents:
diff changeset
53 };
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 static const char *INDENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 static const char *TOP_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static const char *GROUP_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 static const char *GRAPH_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 static const char *PROPERTIES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static const char *EDGES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static const char *PROPERTY_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static const char *EDGE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static const char *NODE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 static const char *NODES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static const char *CONTROL_FLOW_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 static const char *REMOVE_EDGE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 static const char *REMOVE_NODE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static const char *METHOD_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static const char *BLOCK_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static const char *BLOCK_DOMINATOR_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 static const char *BLOCK_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 static const char *SUCCESSORS_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 static const char *SUCCESSOR_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 static const char *METHOD_IS_PUBLIC_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 static const char *METHOD_IS_STATIC_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 static const char *TRUE_VALUE;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 static const char *NODE_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static const char *EDGE_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 static const char *NODE_ID_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 static const char *FROM_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
83 static const char *TO_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 static const char *PROPERTY_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
85 static const char *GRAPH_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 static const char *INDEX_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 static const char *METHOD_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 static const char *INLINE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 static const char *BYTECODES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 static const char *METHOD_BCI_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 static const char *METHOD_SHORT_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 static const char *ASSEMBLY_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
93
222
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
94 elapsedTimer _walk_time;
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
95 elapsedTimer _output_time;
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
96 elapsedTimer _build_blocks_time;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 static int _file_count;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 networkStream *_stream;
222
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
100 xmlStream *_xml;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
101 outputStream *_output;
a61af66fc99e Initial load
duke
parents:
diff changeset
102 ciMethod *_current_method;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 int _depth;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 char buffer[128];
a61af66fc99e Initial load
duke
parents:
diff changeset
105 bool _should_send_method;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 PhaseChaitin* _chaitin;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 bool _traverse_outs;
222
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
108 Compile *C;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 static void pre_node(Node* node, void *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 static void post_node(Node* node, void *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 void print_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
114 void print_method(ciMethod *method, int bci, InlineTree *tree);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 void print_inline_tree(InlineTree *tree);
222
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
116 void visit_node(Node *n, void *param);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
117 void walk_nodes(Node *start, void *param);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
118 void begin_elem(const char *s);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
119 void end_elem();
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
120 void begin_head(const char *s);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
121 void end_head();
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
122 void print_attr(const char *name, const char *val);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
123 void print_attr(const char *name, intptr_t val);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
124 void print_prop(const char *name, const char *val);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
125 void print_prop(const char *name, int val);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
126 void tail(const char *name);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
127 void head(const char *name);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
128 void text(const char *s);
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
129 intptr_t get_node_id(Node *n);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
130 IdealGraphPrinter();
a61af66fc99e Initial load
duke
parents:
diff changeset
131 ~IdealGraphPrinter();
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 static void clean_up();
a61af66fc99e Initial load
duke
parents:
diff changeset
136 static IdealGraphPrinter *printer();
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 bool traverse_outs();
a61af66fc99e Initial load
duke
parents:
diff changeset
139 void set_traverse_outs(bool b);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 outputStream *output();
a61af66fc99e Initial load
duke
parents:
diff changeset
141 void print_inlining(Compile* compile);
a61af66fc99e Initial load
duke
parents:
diff changeset
142 void begin_method(Compile* compile);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 void end_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
144 void print_method(Compile* compile, const char *name, int level=1, bool clear_nodes = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void print(Compile* compile, const char *name, Node *root, int level=1, bool clear_nodes = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
146 void print_xml(const char *name);
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 };
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 #endif
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
152
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
153 #endif // SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP