Mercurial > hg > truffle
diff graal/GraalCompiler/src/com/sun/c1x/ir/Merge.java @ 2799:e1dad0edd57a
first part of loop reworking
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 27 May 2011 17:48:28 +0200 |
parents | 0fd105ff30f1 |
children | 6a1e5d7e1f4e |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Merge.java Fri May 27 14:20:30 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Merge.java Fri May 27 17:48:28 2011 +0200 @@ -33,7 +33,7 @@ * about the basic block, including the successor and * predecessor blocks, exception handlers, liveness information, etc. */ -public final class Merge extends StateSplit { +public class Merge extends StateSplit { private static final int INPUT_COUNT = 0; @@ -54,32 +54,18 @@ return false; } - public final boolean isLoopHeader; - - /** - * Index of bytecode that generated this node when appended in a basic block. - * Negative values indicate special cases. - */ - private int bci; - /** * Constructs a new Merge at the specified bytecode index. * @param bci the bytecode index of the start * @param blockID the ID of the block * @param graph */ - public Merge(int bci, boolean isLoopHeader, Graph graph) { + public Merge(Graph graph) { super(CiKind.Illegal, INPUT_COUNT, SUCCESSOR_COUNT, graph); - this.bci = bci; - this.isLoopHeader = isLoopHeader; } - /** - * Gets the bytecode index of this instruction. - * @return the bytecode index of this instruction - */ - public int bci() { - return bci; + protected Merge(int inputCount, int successorCount, Graph graph) { + super(CiKind.Illegal, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); } @Override @@ -99,12 +85,14 @@ builder.append(" -> "); boolean hasSucc = false; for (Node s : this.successors()) { - if (hasSucc) { - builder.append(", "); + if (s != null) { + if (hasSucc) { + builder.append(", "); + } + builder.append("#"); + builder.append(s.id()); + hasSucc = true; } - builder.append("#"); - builder.append(s.id()); - hasSucc = true; } //} return builder.toString(); @@ -264,8 +252,4 @@ return sb.toString(); } - @Override - public String shortName() { - return "Merge #" + id(); - } }