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; 014 015import org.vmmagic.unboxed.*; 016 017/** 018 * Constants defining heap layout constants 019 */ 020public final class HeapLayoutConstants { 021 022 /** The address of the start of the data section of the boot image. */ 023 public static final Address BOOT_IMAGE_DATA_START = 024 Address.fromIntZeroExtend( 0x60000000 ); 025 026 /** The address of the start of the code section of the boot image. */ 027 public static final Address BOOT_IMAGE_CODE_START = 028 Address.fromIntZeroExtend( 0x64000000 ); 029 030 /** The address of the start of the ref map section of the boot image. */ 031 public static final Address BOOT_IMAGE_RMAP_START = 032 Address.fromIntZeroExtend( 0x67000000 ); 033 034 /** The address in virtual memory that is the highest that can be mapped. */ 035 public static final Address MAXIMUM_MAPPABLE = 036 Address.fromIntZeroExtend( 0xb0000000 ); 037 038 /** The current boot image data size */ 039 public static final int BOOT_IMAGE_DATA_SIZE = (BOOT_IMAGE_CODE_START.diff(BOOT_IMAGE_DATA_START).toInt()); 040 041 /** The current boot image code size */ 042 public static final int BOOT_IMAGE_CODE_SIZE = (BOOT_IMAGE_RMAP_START.diff(BOOT_IMAGE_CODE_START).toInt()); 043 044 /** 045 * Limit for boot image data size: fail the build if 046 * {@link org.jikesrvm.Configuration#AllowOversizedImages VM.AllowOversizedImages} 047 * is not set and the boot image data size is greater than or equal to this amount 048 * of bytes. 049 */ 050 public static final int BOOT_IMAGE_DATA_SIZE_LIMIT = 56 << 20; 051 052 /** 053 * Limit for boot image code size: fail the build if 054 * {@link org.jikesrvm.Configuration#AllowOversizedImages VM.AllowOversizedImages} 055 * is not set and the boot image code size is greater than or equal to this amount 056 * of bytes. 057 */ 058 public static final int BOOT_IMAGE_CODE_SIZE_LIMIT = 24 << 20; 059 060 /* Typical compression ratio is about 1/20 */ 061 public static final int BAD_MAP_COMPRESSION = 5; // conservative heuristic 062 public static final int MAX_BOOT_IMAGE_RMAP_SIZE = BOOT_IMAGE_DATA_SIZE/BAD_MAP_COMPRESSION; 063 064 /** The address of the end of the data section of the boot image. */ 065 public static final Address BOOT_IMAGE_DATA_END = BOOT_IMAGE_DATA_START.plus(BOOT_IMAGE_DATA_SIZE); 066 /** The address of the end of the code section of the boot image. */ 067 public static final Address BOOT_IMAGE_CODE_END = BOOT_IMAGE_CODE_START.plus(BOOT_IMAGE_CODE_SIZE); 068 /** The address of the end of the ref map section of the boot image. */ 069 public static final Address BOOT_IMAGE_RMAP_END = BOOT_IMAGE_RMAP_START.plus(MAX_BOOT_IMAGE_RMAP_SIZE); 070 /** The address of the end of the boot image. */ 071 public static final Address BOOT_IMAGE_END = BOOT_IMAGE_RMAP_END; 072 073 private HeapLayoutConstants() { 074 // prevent instantiation 075 } 076 077}