< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 
  25 package org.graalvm.compiler.core.common.cfg;
  26 


  27 public abstract class AbstractBlockBase<T extends AbstractBlockBase<T>> {
  28 
  29     protected int id;
  30     protected int domDepth;
  31 
  32     protected T[] predecessors;
  33     protected T[] successors;
  34 
  35     private T dominator;
  36     private T firstDominated;
  37     private T dominatedSibling;
  38     private int domNumber;
  39     private int maxChildDomNumber;
  40 
  41     private boolean align;
  42     private int linearScanNumber;
  43 
  44     protected AbstractBlockBase() {
  45         this.id = AbstractControlFlowGraph.BLOCK_ID_INITIAL;
  46         this.linearScanNumber = -1;


 154     public abstract Loop<T> getLoop();
 155 
 156     public abstract int getLoopDepth();
 157 
 158     public abstract void delete();
 159 
 160     public abstract boolean isLoopEnd();
 161 
 162     public abstract boolean isLoopHeader();
 163 
 164     public abstract T getPostdominator();
 165 
 166     public abstract double getRelativeFrequency();
 167 
 168     public abstract T getDominator(int distance);
 169 
 170     @Override
 171     public int hashCode() {
 172         return id;
 173     }









 174 }


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 
  25 package org.graalvm.compiler.core.common.cfg;
  26 
  27 import java.util.Comparator;
  28 
  29 public abstract class AbstractBlockBase<T extends AbstractBlockBase<T>> {
  30 
  31     protected int id;
  32     protected int domDepth;
  33 
  34     protected T[] predecessors;
  35     protected T[] successors;
  36 
  37     private T dominator;
  38     private T firstDominated;
  39     private T dominatedSibling;
  40     private int domNumber;
  41     private int maxChildDomNumber;
  42 
  43     private boolean align;
  44     private int linearScanNumber;
  45 
  46     protected AbstractBlockBase() {
  47         this.id = AbstractControlFlowGraph.BLOCK_ID_INITIAL;
  48         this.linearScanNumber = -1;


 156     public abstract Loop<T> getLoop();
 157 
 158     public abstract int getLoopDepth();
 159 
 160     public abstract void delete();
 161 
 162     public abstract boolean isLoopEnd();
 163 
 164     public abstract boolean isLoopHeader();
 165 
 166     public abstract T getPostdominator();
 167 
 168     public abstract double getRelativeFrequency();
 169 
 170     public abstract T getDominator(int distance);
 171 
 172     @Override
 173     public int hashCode() {
 174         return id;
 175     }
 176 
 177     public static class BlockIdComparator implements Comparator<AbstractBlockBase<?>> {
 178         @Override
 179         public int compare(AbstractBlockBase<?> o1, AbstractBlockBase<?> o2) {
 180             return Integer.compare(o1.getId(), o2.getId());
 181         }
 182     }
 183 
 184     public static final BlockIdComparator BLOCK_ID_COMPARATOR = new BlockIdComparator();
 185 }
< prev index next >