Search in sources :

Example 31 with Interruptible

use of org.vmmagic.pragma.Interruptible 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)

Example 32 with Interruptible

use of org.vmmagic.pragma.Interruptible in project JikesRVM by JikesRVM.

the class ObjectHolder method boot.

@Interruptible
public static void boot() {
    refs = new Object[POOLSIZE][];
    // exercise the method to avoid lazy compilation in the future
    Object[] objs = new Object[1];
    int p = handinRefs(objs);
    getRefAt(p, 0);
    cleanRefs(p);
    if (VM.TraceOnStackReplacement) {
        VM.sysWriteln("ObjectHolder booted...");
    }
}
Also used : Entrypoint(org.vmmagic.pragma.Entrypoint) Interruptible(org.vmmagic.pragma.Interruptible)

Example 33 with Interruptible

use of org.vmmagic.pragma.Interruptible in project JikesRVM by JikesRVM.

the class DebugUtil method boot.

@Interruptible
static void boot(BootRecord theBootRecord) {
    // get addresses of TIBs for RVMArray & RVMClass used for testing Type ptrs
    RVMType t = RVMArray.IntArray;
    tibForArrayType = ObjectModel.getTIB(t);
    tibForPrimitiveType = ObjectModel.getTIB(RVMType.IntType);
    t = Magic.getObjectType(BootRecord.the_boot_record);
    tibForClassType = ObjectModel.getTIB(t);
}
Also used : RVMType(org.jikesrvm.classloader.RVMType) Interruptible(org.vmmagic.pragma.Interruptible)

Example 34 with Interruptible

use of org.vmmagic.pragma.Interruptible in project JikesRVM by JikesRVM.

the class MemoryManager method newNonMovingShortArray.

/**
 * Allocates a non moving short array.
 *
 * @param size The size of the array
 * @return the new non moving short array
 */
@NoInline
@Interruptible
public static short[] newNonMovingShortArray(int size) {
    if (!VM.runningVM) {
        return new short[size];
    }
    RVMArray arrayType = RVMArray.ShortArray;
    int headerSize = ObjectModel.computeArrayHeaderSize(arrayType);
    int align = ObjectModel.getAlignment(arrayType);
    int offset = ObjectModel.getOffsetForAlignment(arrayType, false);
    int width = arrayType.getLogElementSize();
    TIB arrayTib = arrayType.getTypeInformationBlock();
    return (short[]) allocateArray(size, width, headerSize, arrayTib, Plan.ALLOC_NON_MOVING, align, offset, Plan.DEFAULT_SITE);
}
Also used : RVMArray(org.jikesrvm.classloader.RVMArray) TIB(org.jikesrvm.objectmodel.TIB) Entrypoint(org.vmmagic.pragma.Entrypoint) Interruptible(org.vmmagic.pragma.Interruptible) NoInline(org.vmmagic.pragma.NoInline)

Example 35 with Interruptible

use of org.vmmagic.pragma.Interruptible in project JikesRVM by JikesRVM.

the class MemoryManager method allocateCode.

/**
 * Allocate a CodeArray into a code space.
 * Currently the interface is fairly primitive;
 * just the number of instructions in the code array and a boolean
 * to indicate hot or cold code.
 * @param numInstrs number of instructions
 * @param isHot is this a request for hot code space allocation?
 * @return The  array
 */
@NoInline
@Interruptible
public static CodeArray allocateCode(int numInstrs, boolean isHot) {
    RVMArray type = RVMType.CodeArrayType;
    int headerSize = ObjectModel.computeArrayHeaderSize(type);
    int align = ObjectModel.getAlignment(type);
    int offset = ObjectModel.getOffsetForAlignment(type, false);
    int width = type.getLogElementSize();
    TIB tib = type.getTypeInformationBlock();
    int allocator = isHot ? Plan.ALLOC_HOT_CODE : Plan.ALLOC_COLD_CODE;
    return (CodeArray) allocateArray(numInstrs, width, headerSize, tib, allocator, align, offset, Plan.DEFAULT_SITE);
}
Also used : CodeArray(org.jikesrvm.compilers.common.CodeArray) RVMArray(org.jikesrvm.classloader.RVMArray) TIB(org.jikesrvm.objectmodel.TIB) Entrypoint(org.vmmagic.pragma.Entrypoint) Interruptible(org.vmmagic.pragma.Interruptible) NoInline(org.vmmagic.pragma.NoInline)

Aggregations

Interruptible (org.vmmagic.pragma.Interruptible)44 Entrypoint (org.vmmagic.pragma.Entrypoint)22 Address (org.vmmagic.unboxed.Address)11 NoInline (org.vmmagic.pragma.NoInline)9 TIB (org.jikesrvm.objectmodel.TIB)8 RVMArray (org.jikesrvm.classloader.RVMArray)7 RVMType (org.jikesrvm.classloader.RVMType)6 RVMMethod (org.jikesrvm.classloader.RVMMethod)3 Offset (org.vmmagic.unboxed.Offset)3 NormalMethod (org.jikesrvm.classloader.NormalMethod)2 RVMClass (org.jikesrvm.classloader.RVMClass)2 CodeArray (org.jikesrvm.compilers.common.CodeArray)2 CallSiteTreeNode (org.jikesrvm.compilers.opt.inlining.CallSiteTreeNode)2 CollectorThread (org.jikesrvm.mm.mminterface.CollectorThread)2 Extent (org.vmmagic.unboxed.Extent)2 EventAttribute (com.ibm.tuningfork.tracegen.types.EventAttribute)1 Atom (org.jikesrvm.classloader.Atom)1 TypeReference (org.jikesrvm.classloader.TypeReference)1 BaselineCompiledMethod (org.jikesrvm.compilers.baseline.BaselineCompiledMethod)1 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)1