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.runtime;
014
015/**
016 * Constants defining the basic sizes of primitive quantities
017 */
018public final class JavaSizeConstants {
019
020  public static final int LOG_BYTES_IN_BYTE = 0;
021  public static final int BYTES_IN_BYTE = 1;
022  public static final int LOG_BITS_IN_BYTE = 3;
023  public static final int BITS_IN_BYTE = 1 << LOG_BITS_IN_BYTE;
024
025  public static final int LOG_BYTES_IN_BOOLEAN = 0;
026  public static final int BYTES_IN_BOOLEAN = 1 << LOG_BYTES_IN_BOOLEAN;
027  public static final int LOG_BITS_IN_BOOLEAN = LOG_BITS_IN_BYTE + LOG_BYTES_IN_BOOLEAN;
028  public static final int BITS_IN_BOOLEAN = 1 << LOG_BITS_IN_BOOLEAN;
029
030  public static final int LOG_BYTES_IN_CHAR = 1;
031  public static final int BYTES_IN_CHAR = 1 << LOG_BYTES_IN_CHAR;
032  public static final int LOG_BITS_IN_CHAR = LOG_BITS_IN_BYTE + LOG_BYTES_IN_CHAR;
033  public static final int BITS_IN_CHAR = 1 << LOG_BITS_IN_CHAR;
034
035  public static final int LOG_BYTES_IN_SHORT = 1;
036  public static final int BYTES_IN_SHORT = 1 << LOG_BYTES_IN_SHORT;
037  public static final int LOG_BITS_IN_SHORT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_SHORT;
038  public static final int BITS_IN_SHORT = 1 << LOG_BITS_IN_SHORT;
039
040  public static final int LOG_BYTES_IN_INT = 2;
041  public static final int BYTES_IN_INT = 1 << LOG_BYTES_IN_INT;
042  public static final int LOG_BITS_IN_INT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_INT;
043  public static final int BITS_IN_INT = 1 << LOG_BITS_IN_INT;
044
045  public static final int LOG_BYTES_IN_FLOAT = 2;
046  public static final int BYTES_IN_FLOAT = 1 << LOG_BYTES_IN_FLOAT;
047  public static final int LOG_BITS_IN_FLOAT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_FLOAT;
048  public static final int BITS_IN_FLOAT = 1 << LOG_BITS_IN_FLOAT;
049
050  public static final int LOG_BYTES_IN_LONG = 3;
051  public static final int BYTES_IN_LONG = 1 << LOG_BYTES_IN_LONG;
052  public static final int LOG_BITS_IN_LONG = LOG_BITS_IN_BYTE + LOG_BYTES_IN_LONG;
053  public static final int BITS_IN_LONG = 1 << LOG_BITS_IN_LONG;
054
055  public static final int LOG_BYTES_IN_DOUBLE = 3;
056  public static final int BYTES_IN_DOUBLE = 1 << LOG_BYTES_IN_DOUBLE;
057  public static final int LOG_BITS_IN_DOUBLE = LOG_BITS_IN_BYTE + LOG_BYTES_IN_DOUBLE;
058  public static final int BITS_IN_DOUBLE = 1 << LOG_BITS_IN_DOUBLE;
059
060  private JavaSizeConstants() {
061    // prevent instantiation
062  }
063
064}