# HG changeset patch # User Thomas Wuerthinger # Date 1306762582 -7200 # Node ID 774d2bc061484254cb4dfddeaa4dd72455cd6fbb # Parent bf12196e2a60cfe74e0c4f6742116b80c82ba2bd# Parent 878bbf7dbf3166f4f6a9a27e3858daa744a858d7 Merge. diff -r bf12196e2a60 -r 774d2bc06148 graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java --- a/graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java Mon May 30 15:36:06 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java Mon May 30 15:36:22 2011 +0200 @@ -126,7 +126,7 @@ stream.println(" "); for (Block block : schedule.getBlocks()) { - printBlock(block); + printBlock(graph, block); } printNoBlock(); stream.println(" "); @@ -138,7 +138,7 @@ ArrayList edges = new ArrayList(); for (Node node : nodes) { - if (node == Node.Null || omittedClasses.contains(node)) { + if (node == Node.Null || omittedClasses.contains(node.getClass())) { continue; } @@ -196,7 +196,7 @@ stream.printf(" %n", edge.from, edge.fromIndex, edge.to, edge.toIndex); } - private void printBlock(Block block) { + private void printBlock(Graph graph, Block block) { stream.printf(" %n", block.blockID()); stream.printf(" %n"); for (Block sux : block.getSuccessors()) { @@ -208,8 +208,38 @@ } stream.printf(" %n"); stream.printf(" %n"); + + ArrayList nodes = new ArrayList(block.getInstructions()); + // if this is the first block: add all locals to this block + if (nodes.get(0) == graph.start()) { + for (Node node : graph.getNodes()) { + if (node instanceof Local) { + nodes.add(node); + } + } + } + // add all framestates and phis to their blocks for (Node node : block.getInstructions()) { - stream.printf(" %n", node.id()); + if (node instanceof Instruction && ((Instruction) node).stateAfter() != null) { + nodes.add(((Instruction) node).stateAfter()); + } + if (node instanceof Merge) { + Merge merge = (Merge) node; + if (merge.stateBefore() != null) { + nodes.add(merge.stateBefore()); + } + for (Node usage : merge.usages()) { + if (usage instanceof Phi) { + nodes.add(usage); + } + } + } + } + + for (Node node : nodes) { + if (!omittedClasses.contains(node.getClass())) { + stream.printf(" %n", node.id()); + } } stream.printf(" %n"); stream.printf(" %n", block.blockID());