Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java @ 7530:5e3d1a68664e
applied mx eclipseformat to all Java files
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 23 Jan 2013 16:34:57 +0100 |
parents | 0f8c6dbf68be |
children | 4f8143c9947a |
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java Wed Jan 23 16:34:38 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java Wed Jan 23 16:34:57 2013 +0100 @@ -27,14 +27,14 @@ /** * LIR instructions such as JUMP and BRANCH need to reference their target {@link Block}. However, - * direct references are not possible since the control flow graph (and therefore successors lists) can - * be changed by optimizations - and fixing the instructions is error prone. - * Therefore, we only reference of block B from block A only via the tuple (A, successor-index-of-B), i.e., - * indirectly by storing the index into the successor list of A. - * Note that therefore it is not allowed to reorder the successor list! - * - * Labels of out-of-line stubs can be referenced directly, therefore it is also possible to construct a - * LabelRef for a Label directly via {@link #forLabel}. + * direct references are not possible since the control flow graph (and therefore successors lists) + * can be changed by optimizations - and fixing the instructions is error prone. Therefore, we only + * reference of block B from block A only via the tuple (A, successor-index-of-B), i.e., indirectly + * by storing the index into the successor list of A. Note that therefore it is not allowed to + * reorder the successor list! + * + * Labels of out-of-line stubs can be referenced directly, therefore it is also possible to + * construct a LabelRef for a Label directly via {@link #forLabel}. */ public abstract class LabelRef { @@ -42,34 +42,37 @@ /** * Returns a new reference to a statically defined label. + * * @param label The label that is always returned. * @return The newly created label reference. */ public static LabelRef forLabel(final Label label) { - return new LabelRef() { - @Override - public Label label() { - return label; - } + return new LabelRef() { - @Override - public String toString() { - return label.toString(); - } - }; + @Override + public Label label() { + return label; + } + + @Override + public String toString() { + return label.toString(); + } + }; } /** - * Returns a new reference to a successor of the given block. - * This allows to reference the given successor even when the successor list - * is modified between the creation of the reference and the call to {@link #forLabel(Label)}. - * + * Returns a new reference to a successor of the given block. This allows to reference the given + * successor even when the successor list is modified between the creation of the reference and + * the call to {@link #forLabel(Label)}. + * * @param block The base block that contains the successor list. * @param suxIndex The index of the successor. * @return The newly created label reference. */ public static LabelRef forSuccessor(final LIR lir, final Block block, final int suxIndex) { return new LabelRef() { + @Override public Label label() { return ((StandardOp.LabelOp) lir.lir(block.getSuccessors().get(suxIndex)).get(0)).getLabel();