use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method floatFieldWrite.
/**
* Barrier for writes of floats 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 floatFieldWrite(Object ref, float value, Offset offset, int locationMetadata) {
if (NEEDS_FLOAT_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().floatWrite(src, src.toAddress().plus(offset), value, offset.toWord(), Word.fromIntZeroExtend(locationMetadata), INSTANCE_FIELD);
} else if (VM.VerifyAssertions)
VM._assert(VM.NOT_REACHED);
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method objectFieldWrite.
/**
* Barrier for writes of objects 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 objectFieldWrite(Object ref, Object value, Offset offset, int locationMetadata) {
if (NEEDS_OBJECT_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().objectReferenceWrite(src, src.toAddress().plus(offset), ObjectReference.fromObject(value), offset.toWord(), Word.fromIntZeroExtend(locationMetadata), INSTANCE_FIELD);
} else if (VM.VerifyAssertions)
VM._assert(VM.NOT_REACHED);
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method longArrayWrite.
/**
* Barrier for writes of longs into arrays (i.e. lastore).
*
* @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 longArrayWrite(long[] ref, int index, long value) {
if (NEEDS_LONG_GC_WRITE_BARRIER) {
ObjectReference array = ObjectReference.fromObject(ref);
Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_LONG);
Selected.Mutator.get().longWrite(array, array.toAddress().plus(offset), value, offset.toWord(), Word.zero(), ARRAY_ELEMENT);
} else if (VM.VerifyAssertions)
VM._assert(VM.NOT_REACHED);
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method charArrayRead.
/**
* Barrier for loads of chars from fields of arrays (i.e. caload).
*
* @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 char charArrayRead(char[] ref, int index) {
if (NEEDS_CHAR_GC_READ_BARRIER) {
ObjectReference array = ObjectReference.fromObject(ref);
Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_CHAR);
return Selected.Mutator.get().charRead(array, array.toAddress().plus(offset), offset.toWord(), Word.zero(), ARRAY_ELEMENT);
} else if (VM.VerifyAssertions)
VM._assert(VM.NOT_REACHED);
return 0;
}
use of org.vmmagic.unboxed.ObjectReference 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);
}
Aggregations