Search in sources :

Example 11 with Inline

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

the class Barriers method objectArrayRead.

/**
 * Barrier for loads of objects from fields of arrays (i.e. aaload).
 *
 * @param ref the array containing the reference.
 * @param index the index into the array were the reference resides.
 * @return the value read from the array
 */
@Inline
@Entrypoint
public static Object objectArrayRead(Object[] ref, int index) {
    if (NEEDS_OBJECT_GC_READ_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_ADDRESS);
        return Selected.Mutator.get().objectReferenceRead(array, array.toAddress().plus(offset), offset.toWord(), Word.zero(), ARRAY_ELEMENT).toObject();
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
    return null;
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Offset(org.vmmagic.unboxed.Offset) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 12 with Inline

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

the class Barriers method shortArrayWrite.

/**
 * Barrier for writes of shorts into arrays (i.e. sastore).
 *
 * @param ref the array which is the subject of the astore
 * @param index the index into the array where the new reference
 * resides.  The index is the "natural" index into the array, for
 * example a[index].
 * @param value the value to be stored.
 */
@Inline
@Entrypoint
public static void shortArrayWrite(short[] ref, int index, short value) {
    if (NEEDS_SHORT_GC_WRITE_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_SHORT);
        Selected.Mutator.get().shortWrite(array, array.toAddress().plus(offset), value, offset.toWord(), Word.zero(), ARRAY_ELEMENT);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Offset(org.vmmagic.unboxed.Offset) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 13 with Inline

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

the class Barriers method intArrayRead.

/**
 * Barrier for loads of ints from fields of arrays (i.e. iaload).
 *
 * @param ref the array containing the reference.
 * @param index the index into the array were the reference resides.
 * @return the value read from the array
 */
@Inline
@Entrypoint
public static int intArrayRead(int[] ref, int index) {
    if (NEEDS_INT_GC_READ_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_INT);
        return Selected.Mutator.get().intRead(array, array.toAddress().plus(offset), offset.toWord(), Word.zero(), ARRAY_ELEMENT);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
    return 0;
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Offset(org.vmmagic.unboxed.Offset) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 14 with Inline

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

the class Barriers method longArrayRead.

/**
 * Barrier for loads of longs from fields of arrays (i.e. laload).
 *
 * @param ref the array containing the reference.
 * @param index the index into the array were the reference resides.
 * @return the value read from the array
 */
@Inline
@Entrypoint
public static long longArrayRead(long[] ref, int index) {
    if (NEEDS_LONG_GC_READ_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_LONG);
        return Selected.Mutator.get().longRead(array, array.toAddress().plus(offset), offset.toWord(), Word.zero(), ARRAY_ELEMENT);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
    return 0;
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Offset(org.vmmagic.unboxed.Offset) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 15 with Inline

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

the class Barriers method doubleArrayWrite.

/**
 * Barrier for writes of doubles into arrays (i.e. dastore).
 *
 * @param ref the array which is the subject of the astore
 * @param index the index into the array where the new reference
 * resides.  The index is the "natural" index into the array, for
 * example a[index].
 * @param value the value to be stored.
 */
@Inline
@Entrypoint
public static void doubleArrayWrite(double[] ref, int index, double value) {
    if (NEEDS_DOUBLE_GC_WRITE_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_DOUBLE);
        Selected.Mutator.get().doubleWrite(array, array.toAddress().plus(offset), value, offset.toWord(), Word.zero(), ARRAY_ELEMENT);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Offset(org.vmmagic.unboxed.Offset) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Aggregations

Inline (org.vmmagic.pragma.Inline)110 NoInline (org.vmmagic.pragma.NoInline)42 Entrypoint (org.vmmagic.pragma.Entrypoint)40 Offset (org.vmmagic.unboxed.Offset)38 ObjectReference (org.vmmagic.unboxed.ObjectReference)35 Address (org.vmmagic.unboxed.Address)15 Word (org.vmmagic.unboxed.Word)15 TypeReference (org.jikesrvm.classloader.TypeReference)12 Uninterruptible (org.vmmagic.pragma.Uninterruptible)6 RVMType (org.jikesrvm.classloader.RVMType)5 RVMClass (org.jikesrvm.classloader.RVMClass)4 Unpreemptible (org.vmmagic.pragma.Unpreemptible)4 RVMClassLoader (org.jikesrvm.classloader.RVMClassLoader)3 TIB (org.jikesrvm.objectmodel.TIB)3 Extent (org.vmmagic.unboxed.Extent)3 MethodReference (org.jikesrvm.classloader.MethodReference)2 ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)2 RVMThread (org.jikesrvm.scheduler.RVMThread)2 CollectorContext (org.mmtk.plan.CollectorContext)2 NoNullCheck (org.vmmagic.pragma.NoNullCheck)2