annotate src/share/vm/opto/idealGraphPrinter.hpp @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents a61af66fc99e
children 2a1a77d3458f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
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 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 class Compile;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 class PhaseIFG;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 class PhaseChaitin;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 class Matcher;
a61af66fc99e Initial load
duke
parents:
diff changeset
31 class Node;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 class InlineTree;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class ciMethod;
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class IdealGraphPrinter
a61af66fc99e Initial load
duke
parents:
diff changeset
36 {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 enum State
a61af66fc99e Initial load
duke
parents:
diff changeset
40 {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 Invalid,
a61af66fc99e Initial load
duke
parents:
diff changeset
42 Valid,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 New
a61af66fc99e Initial load
duke
parents:
diff changeset
44 };
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 static const char *INDENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 static const char *TOP_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 static const char *GROUP_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static const char *GRAPH_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 static const char *PROPERTIES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 static const char *EDGES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 static const char *PROPERTY_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 static const char *EDGE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 static const char *NODE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 static const char *NODES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 static const char *CONTROL_FLOW_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static const char *REMOVE_EDGE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 static const char *REMOVE_NODE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 static const char *METHOD_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static const char *BLOCK_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static const char *BLOCK_DOMINATOR_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static const char *BLOCK_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static const char *SUCCESSORS_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 static const char *SUCCESSOR_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static const char *METHOD_IS_PUBLIC_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 static const char *METHOD_IS_STATIC_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 static const char *TRUE_VALUE;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static const char *NODE_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static const char *EDGE_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static const char *NODE_ID_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 static const char *FROM_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 static const char *TO_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 static const char *PROPERTY_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 static const char *GRAPH_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 static const char *INDEX_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 static const char *METHOD_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 static const char *INLINE_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static const char *BYTECODES_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 static const char *METHOD_BCI_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 static const char *METHOD_SHORT_NAME_PROPERTY;
a61af66fc99e Initial load
duke
parents:
diff changeset
83 static const char *ASSEMBLY_ELEMENT;
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 class Property {
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 const char *_name;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 const char *_value;
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 Property();
a61af66fc99e Initial load
duke
parents:
diff changeset
95 Property(const Property* p);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 ~Property();
a61af66fc99e Initial load
duke
parents:
diff changeset
97 Property(const char *name, const char *value);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 Property(const char *name, int value);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 bool equals(Property* p);
a61af66fc99e Initial load
duke
parents:
diff changeset
100 void print(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 void print_as_attribute(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
102 bool is_null();
a61af66fc99e Initial load
duke
parents:
diff changeset
103 void clean();
a61af66fc99e Initial load
duke
parents:
diff changeset
104 const char *name();
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 static const char* dup(const char *str) {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 char * copy = new char[strlen(str)+1];
a61af66fc99e Initial load
duke
parents:
diff changeset
108 strcpy(copy, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
109 return copy;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 };
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 class Properties {
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 GrowableArray<Property *> *list;
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 Properties();
a61af66fc99e Initial load
duke
parents:
diff changeset
123 ~Properties();
a61af66fc99e Initial load
duke
parents:
diff changeset
124 void add(Property *p);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 void remove(const char *name);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 bool equals(Properties* p);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 void print(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
128 void print_as_attributes(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
129 void clean();
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 };
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 class Description {
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 State _state;
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 Description();
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 State state();
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void set_state(State s);
a61af66fc99e Initial load
duke
parents:
diff changeset
146 void print(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
147 virtual void print_changed(IdealGraphPrinter *printer) = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 virtual void print_removed(IdealGraphPrinter *printer) = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 };
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 class NodeDescription : public Description{
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static int count;
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 GrowableArray<NodeDescription *> _succs;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 int _block_index;
a61af66fc99e Initial load
duke
parents:
diff changeset
162 uintptr_t _id;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 Properties _properties;
a61af66fc99e Initial load
duke
parents:
diff changeset
164 Node* _node;
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 NodeDescription(Node* node);
a61af66fc99e Initial load
duke
parents:
diff changeset
169 ~NodeDescription();
a61af66fc99e Initial load
duke
parents:
diff changeset
170 Node* node();
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 // void set_node(Node* node);
a61af66fc99e Initial load
duke
parents:
diff changeset
173 GrowableArray<NodeDescription *>* succs();
a61af66fc99e Initial load
duke
parents:
diff changeset
174 void init_succs();
a61af66fc99e Initial load
duke
parents:
diff changeset
175 void clear_succs();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 void add_succ(NodeDescription *desc);
a61af66fc99e Initial load
duke
parents:
diff changeset
177 int block_index();
a61af66fc99e Initial load
duke
parents:
diff changeset
178 void set_block_index(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
179 Properties* properties();
a61af66fc99e Initial load
duke
parents:
diff changeset
180 virtual void print_changed(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
181 virtual void print_removed(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 bool equals(NodeDescription *desc);
a61af66fc99e Initial load
duke
parents:
diff changeset
183 uint id();
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 };
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 class Block {
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 NodeDescription *_start;
a61af66fc99e Initial load
duke
parents:
diff changeset
192 NodeDescription *_proj;
a61af66fc99e Initial load
duke
parents:
diff changeset
193 GrowableArray<int> _succs;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 GrowableArray<NodeDescription *> _nodes;
a61af66fc99e Initial load
duke
parents:
diff changeset
195 GrowableArray<int> _dominates;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 GrowableArray<int> _children;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 int _semi;
a61af66fc99e Initial load
duke
parents:
diff changeset
198 int _parent;
a61af66fc99e Initial load
duke
parents:
diff changeset
199 GrowableArray<int> _pred;
a61af66fc99e Initial load
duke
parents:
diff changeset
200 GrowableArray<int> _bucket;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 int _index;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 int _dominator;
a61af66fc99e Initial load
duke
parents:
diff changeset
203 int _ancestor;
a61af66fc99e Initial load
duke
parents:
diff changeset
204 int _label;
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 Block();
a61af66fc99e Initial load
duke
parents:
diff changeset
209 Block(int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 void add_node(NodeDescription *n);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 GrowableArray<NodeDescription *>* nodes();
a61af66fc99e Initial load
duke
parents:
diff changeset
213 GrowableArray<int>* children();
a61af66fc99e Initial load
duke
parents:
diff changeset
214 void add_child(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
215 void add_succ(int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
216 GrowableArray<int>* succs();
a61af66fc99e Initial load
duke
parents:
diff changeset
217 GrowableArray<int>* dominates();
a61af66fc99e Initial load
duke
parents:
diff changeset
218 void add_dominates(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
219 NodeDescription *start();
a61af66fc99e Initial load
duke
parents:
diff changeset
220 NodeDescription *proj();
a61af66fc99e Initial load
duke
parents:
diff changeset
221 void set_start(NodeDescription *n);
a61af66fc99e Initial load
duke
parents:
diff changeset
222 void set_proj(NodeDescription *n);
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 int label();
a61af66fc99e Initial load
duke
parents:
diff changeset
225 void set_label(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
226 int ancestor();
a61af66fc99e Initial load
duke
parents:
diff changeset
227 void set_ancestor(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
228 int index();
a61af66fc99e Initial load
duke
parents:
diff changeset
229 int dominator();
a61af66fc99e Initial load
duke
parents:
diff changeset
230 void set_dominator(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 int parent();
a61af66fc99e Initial load
duke
parents:
diff changeset
232 void set_parent(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 int semi();
a61af66fc99e Initial load
duke
parents:
diff changeset
234 GrowableArray<int>* bucket();
a61af66fc99e Initial load
duke
parents:
diff changeset
235 void add_to_bucket(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 void clear_bucket();
a61af66fc99e Initial load
duke
parents:
diff changeset
237 GrowableArray<int>* pred();
a61af66fc99e Initial load
duke
parents:
diff changeset
238 void set_semi(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
239 void add_pred(int i);
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 };
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243 class EdgeDescription : public Description {
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 int _from;
a61af66fc99e Initial load
duke
parents:
diff changeset
248 int _to;
a61af66fc99e Initial load
duke
parents:
diff changeset
249 int _index;
a61af66fc99e Initial load
duke
parents:
diff changeset
250 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 EdgeDescription(int from, int to, int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 ~EdgeDescription();
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 virtual void print_changed(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
256 virtual void print_removed(IdealGraphPrinter *printer);
a61af66fc99e Initial load
duke
parents:
diff changeset
257 bool equals(EdgeDescription *desc);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 int from();
a61af66fc99e Initial load
duke
parents:
diff changeset
259 int to();
a61af66fc99e Initial load
duke
parents:
diff changeset
260 };
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 static int _file_count;
a61af66fc99e Initial load
duke
parents:
diff changeset
264 networkStream *_stream;
a61af66fc99e Initial load
duke
parents:
diff changeset
265 outputStream *_output;
a61af66fc99e Initial load
duke
parents:
diff changeset
266 ciMethod *_current_method;
a61af66fc99e Initial load
duke
parents:
diff changeset
267 GrowableArray<NodeDescription *> _nodes;
a61af66fc99e Initial load
duke
parents:
diff changeset
268 GrowableArray<EdgeDescription *> _edges;
a61af66fc99e Initial load
duke
parents:
diff changeset
269 int _depth;
a61af66fc99e Initial load
duke
parents:
diff changeset
270 Arena *_arena;
a61af66fc99e Initial load
duke
parents:
diff changeset
271 char buffer[128];
a61af66fc99e Initial load
duke
parents:
diff changeset
272 bool _should_send_method;
a61af66fc99e Initial load
duke
parents:
diff changeset
273 PhaseChaitin* _chaitin;
a61af66fc99e Initial load
duke
parents:
diff changeset
274 bool _clear_nodes;
a61af66fc99e Initial load
duke
parents:
diff changeset
275 Matcher* _matcher;
a61af66fc99e Initial load
duke
parents:
diff changeset
276 bool _traverse_outs;
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 void start_element_helper(const char *name, Properties *properties, bool endElement, bool print_indent = false, bool print_return = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
279 NodeDescription *create_node_description(Node* node);
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 static void pre_node(Node* node, void *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
282 static void post_node(Node* node, void *env);
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284 void schedule_latest(int **common_dominator, GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
285 void build_common_dominator(int **common_dominator, int index, GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
286 void compress(int index, GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
287 int eval(int index, GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
288 void link(int index1, int index2, GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
289 void build_dominators(GrowableArray<Block>* blocks);
a61af66fc99e Initial load
duke
parents:
diff changeset
290 void build_blocks(Node *node);
a61af66fc99e Initial load
duke
parents:
diff changeset
291 void walk(Node *n);
a61af66fc99e Initial load
duke
parents:
diff changeset
292 void start_element(const char *name, Properties *properties = NULL, bool print_indent = false, bool print_return = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
293 void simple_element(const char *name, Properties *properties = NULL, bool print_indent = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
294 void end_element(const char *name, bool print_indent = false, bool print_return = true);
a61af66fc99e Initial load
duke
parents:
diff changeset
295 void print_edge(int from, int to, int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
296 void print_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
297 void print_method(ciMethod *method, int bci, InlineTree *tree);
a61af66fc99e Initial load
duke
parents:
diff changeset
298 void print_inline_tree(InlineTree *tree);
a61af66fc99e Initial load
duke
parents:
diff changeset
299 void clear_nodes();
a61af66fc99e Initial load
duke
parents:
diff changeset
300
a61af66fc99e Initial load
duke
parents:
diff changeset
301 IdealGraphPrinter();
a61af66fc99e Initial load
duke
parents:
diff changeset
302 ~IdealGraphPrinter();
a61af66fc99e Initial load
duke
parents:
diff changeset
303
a61af66fc99e Initial load
duke
parents:
diff changeset
304 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
305
a61af66fc99e Initial load
duke
parents:
diff changeset
306 static void clean_up();
a61af66fc99e Initial load
duke
parents:
diff changeset
307 static IdealGraphPrinter *printer();
a61af66fc99e Initial load
duke
parents:
diff changeset
308
a61af66fc99e Initial load
duke
parents:
diff changeset
309 bool traverse_outs();
a61af66fc99e Initial load
duke
parents:
diff changeset
310 void set_traverse_outs(bool b);
a61af66fc99e Initial load
duke
parents:
diff changeset
311 void print_ifg(PhaseIFG* ifg);
a61af66fc99e Initial load
duke
parents:
diff changeset
312 outputStream *output();
a61af66fc99e Initial load
duke
parents:
diff changeset
313 void print_inlining(Compile* compile);
a61af66fc99e Initial load
duke
parents:
diff changeset
314 void begin_method(Compile* compile);
a61af66fc99e Initial load
duke
parents:
diff changeset
315 void end_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
316 void print_method(Compile* compile, const char *name, int level=1, bool clear_nodes = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
317 void print(Compile* compile, const char *name, Node *root, int level=1, bool clear_nodes = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
318 void print_xml(const char *name);
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320
a61af66fc99e Initial load
duke
parents:
diff changeset
321 };
a61af66fc99e Initial load
duke
parents:
diff changeset
322
a61af66fc99e Initial load
duke
parents:
diff changeset
323 #endif