use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Barriers method booleanArrayWrite.
/**
* Barrier for writes of booleans 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 booleanArrayWrite(boolean[] ref, int index, boolean value) {
if (NEEDS_BOOLEAN_GC_WRITE_BARRIER) {
ObjectReference array = ObjectReference.fromObject(ref);
Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_BOOLEAN);
Selected.Mutator.get().booleanWrite(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 addressFieldWrite.
/**
* Barrier for writes of Address's 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 addressFieldWrite(Object ref, Address value, Offset offset, int locationMetadata) {
if (NEEDS_ADDRESS_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().addressWrite(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 intArrayWrite.
/**
* Barrier for writes of ints into arrays (i.e. iastore).
*
* @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 intArrayWrite(int[] ref, int index, int value) {
if (NEEDS_INT_GC_WRITE_BARRIER) {
ObjectReference array = ObjectReference.fromObject(ref);
Offset offset = Offset.fromIntZeroExtend(index << LOG_BYTES_IN_INT);
Selected.Mutator.get().intWrite(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 offsetFieldWrite.
/**
* Barrier for writes of Offsets 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 offsetFieldWrite(Object ref, Offset value, Offset offset, int locationMetadata) {
if (NEEDS_OFFSET_GC_WRITE_BARRIER) {
ObjectReference src = ObjectReference.fromObject(ref);
Selected.Mutator.get().offsetWrite(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 DebugUtil method dumpRef.
@Uninterruptible
public static void dumpRef(ObjectReference ref) {
VM.sysWrite("REF=");
if (ref.isNull()) {
VM.sysWriteln("NULL");
VM.sysWriteln();
return;
}
VM.sysWrite(ref);
if (!mappedVMRef(ref)) {
VM.sysWriteln(" (REF OUTSIDE OF HEAP OR NOT MAPPED)");
return;
}
ObjectModel.dumpHeader(ref);
ObjectReference tib = ObjectReference.fromObject(ObjectModel.getTIB(ref));
if (!MemoryManager.mightBeTIB(tib)) {
VM.sysWriteln(" (INVALID TIB: CLASS NOT ACCESSIBLE)");
return;
}
RVMType type = Magic.getObjectType(ref.toObject());
ObjectReference itype = ObjectReference.fromObject(type);
VM.sysWrite(" TYPE=");
VM.sysWrite(itype);
if (!validType(itype)) {
VM.sysWriteln(" (INVALID TYPE: CLASS NOT ACCESSIBLE)");
return;
}
VM.sysWrite(" CLASS=");
VM.sysWrite(type.getDescriptor());
VM.sysWriteln();
}
Aggregations