Search in sources :

Example 66 with Entrypoint

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

the class Barriers method byteArrayWrite.

/**
 * Barrier for writes of bytes into arrays (i.e. bastore).
 *
 * @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 byteArrayWrite(byte[] ref, int index, byte value) {
    if (NEEDS_BYTE_GC_WRITE_BARRIER) {
        ObjectReference array = ObjectReference.fromObject(ref);
        Offset offset = Offset.fromIntZeroExtend(index);
        Selected.Mutator.get().byteWrite(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 67 with Entrypoint

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

the class Barriers method doubleFieldWrite.

/**
 * Barrier for writes of doubles into fields of instances (i.e. putfield).
 *
 * @param ref the object which is the subject of the putfield
 * @param value the new value for the field
 * @param offset the offset of the field to be modified
 * @param locationMetadata an int that encodes the source location being modified
 */
@Inline
@Entrypoint
public static void doubleFieldWrite(Object ref, double value, Offset offset, int locationMetadata) {
    if (NEEDS_DOUBLE_GC_WRITE_BARRIER) {
        ObjectReference src = ObjectReference.fromObject(ref);
        Selected.Mutator.get().doubleWrite(src, src.toAddress().plus(offset), value, offset.toWord(), Word.fromIntZeroExtend(locationMetadata), INSTANCE_FIELD);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 68 with Entrypoint

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

the class Barriers method charFieldWrite.

/**
 * Barrier for writes of chars into fields of instances (i.e. putfield).
 *
 * @param ref the object which is the subject of the putfield
 * @param value the new value for the field
 * @param offset the offset of the field to be modified
 * @param locationMetadata an int that encodes the source location being modified
 */
@Inline
@Entrypoint
public static void charFieldWrite(Object ref, char value, Offset offset, int locationMetadata) {
    if (NEEDS_CHAR_GC_WRITE_BARRIER) {
        ObjectReference src = ObjectReference.fromObject(ref);
        Selected.Mutator.get().charWrite(src, src.toAddress().plus(offset), value, offset.toWord(), Word.fromIntZeroExtend(locationMetadata), INSTANCE_FIELD);
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Example 69 with Entrypoint

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

the class Barriers method objectStaticWrite.

/**
 * Barrier for writes of objects from statics (eg putstatic)
 *
 * @param value the new value to be stored
 * @param offset the offset of the field to be modified
 * @param locationMetadata an int that encodes the source location being modified
 */
@Inline
@Entrypoint
public static void objectStaticWrite(Object value, Offset offset, int locationMetadata) {
    if (NEEDS_OBJECT_GC_PUTSTATIC_BARRIER) {
        ObjectReference src = ObjectReference.fromObject(Magic.getJTOC());
        Selected.Mutator.get().objectReferenceNonHeapWrite(src.toAddress().plus(offset), ObjectReference.fromObject(value), offset.toWord(), Word.fromIntZeroExtend(locationMetadata));
    } else if (VM.VerifyAssertions)
        VM._assert(VM.NOT_REACHED);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) Entrypoint(org.vmmagic.pragma.Entrypoint) Inline(org.vmmagic.pragma.Inline)

Aggregations

Entrypoint (org.vmmagic.pragma.Entrypoint)69 Inline (org.vmmagic.pragma.Inline)35 ObjectReference (org.vmmagic.unboxed.ObjectReference)33 Offset (org.vmmagic.unboxed.Offset)22 Address (org.vmmagic.unboxed.Address)12 TypeReference (org.jikesrvm.classloader.TypeReference)7 NoInline (org.vmmagic.pragma.NoInline)7 RVMType (org.jikesrvm.classloader.RVMType)6 Unpreemptible (org.vmmagic.pragma.Unpreemptible)6 RVMMethod (org.jikesrvm.classloader.RVMMethod)5 RVMArray (org.jikesrvm.classloader.RVMArray)3 RVMClass (org.jikesrvm.classloader.RVMClass)3 RVMThread (org.jikesrvm.scheduler.RVMThread)3 BaselineSaveLSRegisters (org.vmmagic.pragma.BaselineSaveLSRegisters)3 NoOptCompile (org.vmmagic.pragma.NoOptCompile)3 AbstractRegisters (org.jikesrvm.architecture.AbstractRegisters)2 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)2 ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)2 ITable (org.jikesrvm.objectmodel.ITable)2 TIB (org.jikesrvm.objectmodel.TIB)2