Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/debug/BlockPrinter.java @ 2546:e1b3db8031ee
Removed liveness marking.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 21:54:31 +0200 |
parents | 16b9a8b5ad39 |
children | 274360f98f97 |
comparison
equal
deleted
inserted
replaced
2545:bb050fe2901d | 2546:e1b3db8031ee |
---|---|
27 import com.sun.c1x.util.*; | 27 import com.sun.c1x.util.*; |
28 import com.sun.c1x.value.*; | 28 import com.sun.c1x.value.*; |
29 | 29 |
30 /** | 30 /** |
31 * Prints a listing for a {@linkplain BlockBegin block}. | 31 * Prints a listing for a {@linkplain BlockBegin block}. |
32 * | |
33 * @author Doug Simon | |
34 */ | 32 */ |
35 public class BlockPrinter implements BlockClosure { | 33 public class BlockPrinter implements BlockClosure { |
36 | 34 |
37 private final InstructionPrinter ip; | 35 private final InstructionPrinter ip; |
38 private final boolean cfgOnly; | 36 private final boolean cfgOnly; |
39 private final boolean liveOnly; | |
40 | 37 |
41 public BlockPrinter(IR ir, InstructionPrinter ip, boolean cfgOnly, boolean liveOnly) { | 38 public BlockPrinter(IR ir, InstructionPrinter ip, boolean cfgOnly) { |
42 this.ip = ip; | 39 this.ip = ip; |
43 this.cfgOnly = cfgOnly; | 40 this.cfgOnly = cfgOnly; |
44 this.liveOnly = liveOnly; | |
45 } | 41 } |
46 | 42 |
47 public void apply(BlockBegin block) { | 43 public void apply(BlockBegin block) { |
48 if (cfgOnly) { | 44 if (cfgOnly) { |
49 ip.printInstruction(block); | 45 ip.printInstruction(block); |
50 ip.out().println(); | 46 ip.out().println(); |
51 } else { | 47 } else { |
52 printBlock(block, liveOnly); | 48 printBlock(block); |
53 } | 49 } |
54 } | 50 } |
55 | 51 |
56 public void printBlock(BlockBegin block, boolean liveOnly) { | 52 public void printBlock(BlockBegin block) { |
57 ip.printInstruction(block); | 53 ip.printInstruction(block); |
58 LogStream out = ip.out(); | 54 LogStream out = ip.out(); |
59 out.println(); | 55 out.println(); |
60 printFrameState(block.stateBefore(), out); | 56 printFrameState(block.stateBefore(), out); |
61 out.println(); | 57 out.println(); |
63 out.println("inlining depth " + block.stateBefore().scope().level); | 59 out.println("inlining depth " + block.stateBefore().scope().level); |
64 | 60 |
65 ip.printInstructionListingHeader(); | 61 ip.printInstructionListingHeader(); |
66 | 62 |
67 for (Instruction i = block.next(); i != null; i = i.next()) { | 63 for (Instruction i = block.next(); i != null; i = i.next()) { |
68 if (!liveOnly || i.isLive()) { | 64 ip.printInstructionListing(i); |
69 ip.printInstructionListing(i); | |
70 } | |
71 } | 65 } |
72 out.println(); | 66 out.println(); |
73 | 67 |
74 } | 68 } |
75 | 69 |