changeset 16504:b07f96c783ad

Document invariants of AbstractControlFlowGraph.getBlocks().
author Josef Eisl <josef.eisl@jku.at>
date Mon, 14 Jul 2014 19:27:35 +0200
parents b3800429f543
children 45f92700119f
files graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/cfg/AbstractControlFlowGraph.java
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/cfg/AbstractControlFlowGraph.java	Mon Jul 14 19:55:14 2014 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/cfg/AbstractControlFlowGraph.java	Mon Jul 14 19:27:35 2014 +0200
@@ -29,12 +29,28 @@
     static final int BLOCK_ID_INITIAL = -1;
     static final int BLOCK_ID_VISITED = -2;
 
+    /**
+     * Returns the list blocks contained in this control flow graph.
+     *
+     * It is {@linkplain CFGVerifier guaranteed} that the blocks are numbered according to a reverse
+     * post order traversal of the control flow graph.
+     *
+     * @see CFGVerifier
+     */
     List<T> getBlocks();
 
     Collection<Loop<T>> getLoops();
 
     T getStartBlock();
 
+    /**
+     * Calculates the common dominator of two blocks.
+     *
+     * Note that this algorithm makes use of special properties regarding the numbering of blocks.
+     *
+     * @see #getBlocks()
+     * @see CFGVerifier
+     */
     public static AbstractBlock<?> commonDominator(AbstractBlock<?> a, AbstractBlock<?> b) {
         if (a == null) {
             return b;
@@ -55,6 +71,9 @@
         return iterA;
     }
 
+    /**
+     * @see AbstractControlFlowGraph#commonDominator(AbstractBlock, AbstractBlock)
+     */
     @SuppressWarnings("unchecked")
     public static <T extends AbstractBlock<T>> T commonDominatorTyped(T a, T b) {
         return (T) commonDominator(a, b);