Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/debug/CFGPrinter.java @ 2565:cc1f1d396288
Remove inlining (3rd part)
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Fri, 29 Apr 2011 16:46:30 +0200 |
parents | 274360f98f97 |
children | 4a36a0bd6d18 |
comparison
equal
deleted
inserted
replaced
2564:274360f98f97 | 2565:cc1f1d396288 |
---|---|
97 out.adjustIndentation(2); | 97 out.adjustIndentation(2); |
98 } | 98 } |
99 | 99 |
100 private void end(String string) { | 100 private void end(String string) { |
101 out.adjustIndentation(-2); | 101 out.adjustIndentation(-2); |
102 end("states"); | |
103 end("states"); | |
104 end("states"); | |
105 end("states"); | |
106 out.println("end_" + string); | 102 out.println("end_" + string); |
107 } | 103 } |
108 | 104 |
109 /** | 105 /** |
110 * Prints a compilation timestamp for a given method. | 106 * Prints a compilation timestamp for a given method. |
129 * @param printLIR if {@code true} the LIR for each instruction in the block will be printed | 125 * @param printLIR if {@code true} the LIR for each instruction in the block will be printed |
130 */ | 126 */ |
131 void printBlock(BlockBegin block, List<BlockBegin> successors, Iterable<BlockBegin> handlers, boolean printHIR, boolean printLIR) { | 127 void printBlock(BlockBegin block, List<BlockBegin> successors, Iterable<BlockBegin> handlers, boolean printHIR, boolean printLIR) { |
132 begin("block"); | 128 begin("block"); |
133 | 129 |
134 end("states"); | |
135 out.print("name \"B").print(block.blockID).println('"'); | 130 out.print("name \"B").print(block.blockID).println('"'); |
136 out.print("from_bci ").println(block.bci()); | 131 out.print("from_bci ").println(block.bci()); |
137 out.print("to_bci ").println(block.end() == null ? -1 : block.end().bci()); | 132 out.print("to_bci ").println(block.end() == null ? -1 : block.end().bci()); |
138 | 133 |
139 out.print("predecessors "); | 134 out.print("predecessors "); |
161 if (block.isExceptionEntry()) { | 156 if (block.isExceptionEntry()) { |
162 out.print("\"ex\" "); | 157 out.print("\"ex\" "); |
163 } | 158 } |
164 if (block.isSubroutineEntry()) { | 159 if (block.isSubroutineEntry()) { |
165 out.print("\"sr\" "); | 160 out.print("\"sr\" "); |
166 end("states"); | |
167 end("states"); | |
168 } | 161 } |
169 if (block.isBackwardBranchTarget()) { | 162 if (block.isBackwardBranchTarget()) { |
170 out.print("\"bb\" "); | 163 out.print("\"bb\" "); |
171 } | 164 } |
172 if (block.isParserLoopHeader()) { | 165 if (block.isParserLoopHeader()) { |
214 FrameState state = block.stateBefore(); | 207 FrameState state = block.stateBefore(); |
215 int stackSize = state.stackSize(); | 208 int stackSize = state.stackSize(); |
216 if (stackSize > 0) { | 209 if (stackSize > 0) { |
217 begin("stack"); | 210 begin("stack"); |
218 out.print("size ").println(stackSize); | 211 out.print("size ").println(stackSize); |
219 out.print("method \"").print(CiUtil.toLocation(state.method, state.bci)).println('"'); | 212 out.print("bci ").println(state.bci); |
220 | 213 |
221 int i = 0; | 214 int i = 0; |
222 while (i < stackSize) { | 215 while (i < stackSize) { |
223 Value value = state.stackAt(i); | 216 Value value = state.stackAt(i); |
224 out.disableIndentation(); | 217 out.disableIndentation(); |
236 } | 229 } |
237 | 230 |
238 if (state.locksSize() > 0) { | 231 if (state.locksSize() > 0) { |
239 begin("locks"); | 232 begin("locks"); |
240 out.print("size ").println(state.locksSize()); | 233 out.print("size ").println(state.locksSize()); |
241 out.print("method \"").print(CiUtil.toLocation(state.method, state.bci)).println('"'); | 234 out.print("bci ").println(state.bci); |
242 | 235 |
243 for (int i = 0; i < state.locksSize(); ++i) { | 236 for (int i = 0; i < state.locksSize(); ++i) { |
244 Value value = state.lockAt(i); | 237 Value value = state.lockAt(i); |
245 out.disableIndentation(); | 238 out.disableIndentation(); |
246 out.print(block.stateString(i, value)); | 239 out.print(block.stateString(i, value)); |
251 end("locks"); | 244 end("locks"); |
252 } | 245 } |
253 | 246 |
254 begin("locals"); | 247 begin("locals"); |
255 out.print("size ").println(state.localsSize()); | 248 out.print("size ").println(state.localsSize()); |
256 out.print("method \"").print(CiUtil.toLocation(state.method, state.bci)).println('"'); | 249 out.print("bci ").println(state.bci); |
257 int i = 0; | 250 int i = 0; |
258 while (i < state.localsSize()) { | 251 while (i < state.localsSize()) { |
259 Value value = state.localAt(i); | 252 Value value = state.localAt(i); |
260 if (value != null) { | 253 if (value != null) { |
261 out.disableIndentation(); | 254 out.disableIndentation(); |
280 if (state == null) { | 273 if (state == null) { |
281 return null; | 274 return null; |
282 } | 275 } |
283 | 276 |
284 StringBuilder buf = new StringBuilder(); | 277 StringBuilder buf = new StringBuilder(); |
285 buf.append(CiUtil.toLocation(state.method, state.bci)); | 278 buf.append("[bci: ").append(state.bci).append("]"); |
286 buf.append('\n'); | 279 buf.append('\n'); |
287 if (state.stackSize() > 0) { | 280 if (state.stackSize() > 0) { |
288 int i = 0; | 281 int i = 0; |
289 buf.append("stack: "); | 282 buf.append("stack: "); |
290 while (i < state.stackSize()) { | 283 while (i < state.stackSize()) { |