use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class ObjectModel method copy.
@Override
@Inline
public ObjectReference copy(ObjectReference from, int allocator) {
TIB tib = org.jikesrvm.objectmodel.ObjectModel.getTIB(from);
RVMType type = Magic.objectAsType(tib.getType());
if (type.isClassType())
return copyScalar(from, tib, type.asClass(), allocator);
else
return copyArray(from, tib, type.asArray(), allocator);
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class ScanThread method processCodeLocation.
/**
* Push a code pointer location onto the code locations deque,
* optionally performing a sanity check first.<p>
*
* @param code The code object into which this interior pointer points
* @param ipLoc The location of the pointer into this code object
*/
@Inline
private void processCodeLocation(ObjectReference code, Address ipLoc) {
if (VALIDATE_REFS) {
Address ip = ipLoc.loadAddress();
Offset offset = ip.diff(code.toAddress());
if (offset.sLT(Offset.zero()) || offset.sGT(Offset.fromIntZeroExtend(ObjectModel.getObjectSize(code)))) {
Log.writeln("ERROR: Suspiciously large offset of interior pointer from object base");
Log.writeln(" object base = ", code);
Log.writeln(" interior reference = ", ip);
Log.writeln(" offset = ", offset);
Log.writeln(" interior ref loc = ", ipLoc);
if (!failed)
failed = true;
}
}
trace.processInteriorEdge(code, ipLoc, true);
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class RVMArray method arraycopy.
/**
* Perform an array copy for arrays of doubles.
*
* @param src The source array
* @param srcIdx The starting source index
* @param dst The destination array
* @param dstIdx The starting destination index
* @param len The number of array elements to be copied
*/
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1, 3, 4 })
public static void arraycopy(double[] src, int srcIdx, double[] dst, int dstIdx, int len) {
// are in error
if (srcIdx >= 0 && dstIdx >= 0 && len >= 0 && (srcIdx + len) >= 0 && (srcIdx + len) <= src.length && (dstIdx + len) >= 0 && (dstIdx + len) <= dst.length) {
if ((src != dst || srcIdx > dstIdx) && DOUBLE_BULK_COPY_SUPPORTED) {
if (NEEDS_DOUBLE_ASTORE_BARRIER || NEEDS_DOUBLE_ALOAD_BARRIER) {
Offset srcOffset = Offset.fromIntZeroExtend(srcIdx << LOG_BYTES_IN_DOUBLE);
Offset dstOffset = Offset.fromIntZeroExtend(dstIdx << LOG_BYTES_IN_DOUBLE);
Barriers.doubleBulkCopy(src, srcOffset, dst, dstOffset, len << LOG_BYTES_IN_DOUBLE);
} else {
Memory.arraycopy64Bit(src, srcIdx, dst, dstIdx, len);
}
} else {
arraycopyPiecemeal(src, srcIdx, dst, dstIdx, len);
}
} else {
failWithIndexOutOfBoundsException();
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class RVMArray method arraycopy.
/**
* Perform an array copy for arrays of longs.
*
* @param src The source array
* @param srcIdx The starting source index
* @param dst The destination array
* @param dstIdx The starting destination index
* @param len The number of array elements to be copied
*/
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1, 3, 4 })
public static void arraycopy(long[] src, int srcIdx, long[] dst, int dstIdx, int len) {
// are in error
if (srcIdx >= 0 && dstIdx >= 0 && len >= 0 && (srcIdx + len) >= 0 && (srcIdx + len) <= src.length && (dstIdx + len) >= 0 && (dstIdx + len) <= dst.length) {
if ((src != dst || srcIdx > dstIdx) && LONG_BULK_COPY_SUPPORTED) {
if (NEEDS_LONG_ASTORE_BARRIER || NEEDS_LONG_ALOAD_BARRIER) {
Offset srcOffset = Offset.fromIntZeroExtend(srcIdx << LOG_BYTES_IN_LONG);
Offset dstOffset = Offset.fromIntZeroExtend(dstIdx << LOG_BYTES_IN_LONG);
Barriers.longBulkCopy(src, srcOffset, dst, dstOffset, len << LOG_BYTES_IN_LONG);
} else {
Memory.arraycopy64Bit(src, srcIdx, dst, dstIdx, len);
}
} else {
arraycopyPiecemeal(src, srcIdx, dst, dstIdx, len);
}
} else {
failWithIndexOutOfBoundsException();
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class RVMArray method arraycopy.
/**
* Perform an array copy for arrays of booleans.
*
* @param src The source array
* @param srcIdx The starting source index
* @param dst The destination array
* @param dstIdx The starting destination index
* @param len The number of array elements to be copied
*/
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1, 3, 4 })
public static void arraycopy(boolean[] src, int srcIdx, boolean[] dst, int dstIdx, int len) {
// are in error
if (srcIdx >= 0 && dstIdx >= 0 && len >= 0 && (srcIdx + len) >= 0 && (srcIdx + len) <= src.length && (dstIdx + len) >= 0 && (dstIdx + len) <= dst.length) {
if ((src != dst || srcIdx >= (dstIdx + BYTES_IN_ADDRESS / BYTES_IN_BOOLEAN)) && BOOLEAN_BULK_COPY_SUPPORTED) {
if (NEEDS_BOOLEAN_ASTORE_BARRIER || NEEDS_BOOLEAN_ALOAD_BARRIER) {
Offset srcOffset = Offset.fromIntZeroExtend(srcIdx << LOG_BYTES_IN_BOOLEAN);
Offset dstOffset = Offset.fromIntZeroExtend(dstIdx << LOG_BYTES_IN_BOOLEAN);
Barriers.booleanBulkCopy(src, srcOffset, dst, dstOffset, len);
} else {
Memory.arraycopy8Bit(src, srcIdx, dst, dstIdx, len);
}
} else {
arraycopyPiecemeal(src, srcIdx, dst, dstIdx, len);
}
} else {
failWithIndexOutOfBoundsException();
}
}
Aggregations