001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.jikesrvm.compilers.baseline;
014
015/**
016 * A set of constants that define some useful Java types and stack
017 * sizes that describe the state of a basic block and its stack
018 * contents on entry.
019 */
020public final class BBConstants {
021
022  // first two bits determine the number of Java words making up the
023  // entity
024  public static final byte LENGTH_MASK = 0x03;
025
026  public static final byte VOID_TYPE = 0x00;
027  public static final byte INT_TYPE = 0x01;
028  public static final byte ADDRESS_TYPE = 0x02;
029  public static final byte LONG_TYPE = 0x04;
030  public static final byte FLOAT_TYPE = 0x08;
031  public static final byte DOUBLE_TYPE = 0x10;
032  public static final byte LONGHALF_TYPE = 0x20;
033
034  public static final short DUMMYBLOCK = -1;
035  public static final short STARTBLOCK = 1;
036  public static final short EXITBLOCK = 2;
037  public static final short EXCEPTIONHANDLER = -2;
038
039  public static final byte TARGET_ = 0x10;
040  public static final byte CONDITIONAL_ = 0x20;
041  public static final byte FALLTHRU_ = 0x40;
042  public static final byte TRYSTART_ = (byte) 0x80;
043
044  public static final byte NOTBLOCK = 0x0;
045  public static final byte INJSR_ = 0x1;
046  public static final byte JSRENTRY = 0x2;
047  public static final byte TRYHANDLERSTART = 0x4;
048  public static final byte HASHANDLER_ = 0x8;
049  public static final byte METHODENTRY = TARGET_;
050  public static final byte CONDITIONALTARGET = TARGET_ | CONDITIONAL_;
051  public static final byte UNCONDITIONALTARGET = TARGET_;
052  public static final byte FALLTHRUTARGET = TARGET_ | CONDITIONAL_ | FALLTHRU_;
053
054  private BBConstants() {
055    // prevent instantiation
056  }
057
058}