use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method wordFieldWrite.
/**
* Barrier for writes of Words 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 wordFieldWrite(Object ref, Word value, Offset offset, int locationMetadata) {
if (NEEDS_WORD_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().wordWrite(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 extentFieldWrite.
/**
* Barrier for writes of Extents 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 extentFieldWrite(Object ref, Extent value, Offset offset, int locationMetadata) {
if (NEEDS_EXTENT_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().extentWrite(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 doubleArrayRead.
/**
* Barrier for loads of doubles from fields of arrays (i.e. daload).
*
* @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 double doubleArrayRead(double[] ref, int index) {
if (NEEDS_DOUBLE_GC_READ_BARRIER) {
ObjectReference array = ObjectReference.fromObject(ref);
Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_DOUBLE);
return Selected.Mutator.get().doubleRead(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 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;
}
use of org.vmmagic.unboxed.ObjectReference 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);
}
Aggregations