Search in sources :

Example 1 with ImmortalSpace

use of org.mmtk.policy.ImmortalSpace in project JikesRVM by JikesRVM.

the class Memory method getVMSpace.

/**
 * Return the space associated with/reserved for the VM.  In the
 * case of Jikes RVM this is the boot image space.<p>
 *
 * The boot image space must be mapped at the start of available
 * virtual memory, hence we use the constructor that requests the
 * lowest address in the address space.  The address space awarded
 * to this space depends on the order in which the request is made.
 * If this request is not the first request for virtual memory then
 * the Space allocator will die with an error stating that the
 * request could not be satisfied.  The remedy is to ensure it is
 * initialized first.
 *
 * @return The space managed by the virtual machine.  In this case,
 * the boot image space is returned.
 */
@Override
@Interruptible
public final ImmortalSpace getVMSpace() {
    Offset bootSegmentBytes = BOOT_IMAGE_END.diff(BOOT_IMAGE_DATA_START);
    if (VM.VerifyAssertions)
        VM._assert(bootSegmentBytes.sGT(Offset.zero()));
    int bootSegmentMb = org.jikesrvm.runtime.Memory.alignUp(bootSegmentBytes.toWord().toAddress(), BYTES_IN_CHUNK).toWord().rshl(LOG_BYTES_IN_MBYTE).toInt();
    if (bootSpace == null) {
        bootSpace = new ImmortalSpace("boot", VMRequest.fixedSize(bootSegmentMb));
    }
    return bootSpace;
}
Also used : ImmortalSpace(org.mmtk.policy.ImmortalSpace) Offset(org.vmmagic.unboxed.Offset) Interruptible(org.vmmagic.pragma.Interruptible)

Aggregations

ImmortalSpace (org.mmtk.policy.ImmortalSpace)1 Interruptible (org.vmmagic.pragma.Interruptible)1 Offset (org.vmmagic.unboxed.Offset)1