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
015import static org.jikesrvm.runtime.JavaSizeConstants.LOG_BITS_IN_BYTE;
016
017import org.jikesrvm.VM;
018
019/**
020 * Constants defining the basic sizes of unboxed quantities.
021 */
022public final class UnboxedSizeConstants {
023
024  public static final int LOG_BYTES_IN_ADDRESS = VM.BuildFor64Addr ? 3 : 2;
025  public static final int BYTES_IN_ADDRESS = 1 << LOG_BYTES_IN_ADDRESS;
026  public static final int LOG_BITS_IN_ADDRESS = LOG_BITS_IN_BYTE + LOG_BYTES_IN_ADDRESS;
027  public static final int BITS_IN_ADDRESS = 1 << LOG_BITS_IN_ADDRESS;
028
029  public static final int LOG_BYTES_IN_WORD = VM.BuildFor64Addr ? 3 : 2;
030  public static final int BYTES_IN_WORD = 1 << LOG_BYTES_IN_WORD;
031  public static final int LOG_BITS_IN_WORD = LOG_BITS_IN_BYTE + LOG_BYTES_IN_WORD;
032  public static final int BITS_IN_WORD = 1 << LOG_BITS_IN_WORD;
033
034  public static final int LOG_BYTES_IN_EXTENT = VM.BuildFor64Addr ? 3 : 2;
035  public static final int BYTES_IN_EXTENT = 1 << LOG_BYTES_IN_EXTENT;
036  public static final int LOG_BITS_IN_EXTENT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_EXTENT;
037  public static final int BITS_IN_EXTENT = 1 << LOG_BITS_IN_EXTENT;
038
039  public static final int LOG_BYTES_IN_OFFSET = VM.BuildFor64Addr ? 3 : 2;
040  public static final int BYTES_IN_OFFSET = 1 << LOG_BYTES_IN_OFFSET;
041  public static final int LOG_BITS_IN_OFFSET = LOG_BITS_IN_BYTE + LOG_BYTES_IN_OFFSET;
042  public static final int BITS_IN_OFFSET = 1 << LOG_BITS_IN_OFFSET;
043
044  private UnboxedSizeConstants() {
045    // prevent instantiation
046  }
047
048}