use of org.vmmagic.unboxed.Offset in project JikesRVM by JikesRVM.
the class BytecodeStream method getIntConstant.
/**
* Returns the constant at a given constant pool index (as an int).<p>
* Used for ldc, ldc_w
* @param index index into constant pool
* @return int constant
* @see #getConstantIndex()
* @see #getWideConstantIndex()
* @see #getConstantType(int)
* @see #getLongConstant(int)
* @see #getFloatConstant(int)
* @see #getDoubleConstant(int)
* @see #getStringConstant(int)
*/
public final int getIntConstant(int index) {
if (VM.VerifyAssertions) {
VM._assert((opcode == JBC_ldc || opcode == JBC_ldc_w) && getDeclaringClass().getLiteralDescription(index) == CP_INT);
}
Offset offset = getDeclaringClass().getLiteralOffset(index);
int val = Statics.getSlotContentsAsInt(offset);
return val;
}
use of org.vmmagic.unboxed.Offset in project JikesRVM by JikesRVM.
the class BytecodeStream method getLongConstant.
/**
* Returns the constant at a given constant pool index (as a long).<p>
* Used for ldc2_w
* @param index index into constant pool
* @return long constant
* @see #getConstantIndex()
* @see #getWideConstantIndex()
* @see #getConstantType(int)
* @see #getIntConstant(int)
* @see #getFloatConstant(int)
* @see #getDoubleConstant(int)
* @see #getStringConstant(int)
*/
public final long getLongConstant(int index) {
if (VM.VerifyAssertions) {
VM._assert(opcode == JBC_ldc2_w && getDeclaringClass().getLiteralDescription(index) == CP_LONG);
}
Offset offset = getDeclaringClass().getLiteralOffset(index);
long val = Statics.getSlotContentsAsLong(offset);
return val;
}
use of org.vmmagic.unboxed.Offset in project JikesRVM by JikesRVM.
the class LinearSpaceDriver method transmit.
/**
* Transmit the data if this event is of interest to the client.<p>
* Implemented using the algorithm pattern, subclasses can override parts of it.
* @param event The event, defined in the Plan
*/
@Override
public void transmit(int event) {
if (!server.isConnected(event))
return;
if (DEBUG) {
Log.writeln("CONNECTED");
Log.write(myClass);
Log.write(".send: numTiles=", allTileNum);
// Log.write("LinearSpaceDriver.transmit: numTiles=", allTileNum);
Log.writeln(", control.length=", control.length);
Log.flush();
}
// Setup the summaries
setupSummaries();
// Setup the control info
setupControlInfo();
// Setup the space info
Offset size = subspace.getEnd().diff(subspace.getStart());
setSpaceInfo(size);
// Send the all streams
send(event, allTileNum);
// Debugging
if (VM.VERIFY_ASSERTIONS) {
lastAddress = Address.zero();
lastSize = 0;
}
}
use of org.vmmagic.unboxed.Offset in project JikesRVM by JikesRVM.
the class GenerationContextTest method buildLockObjectForStaticMethod.
private Operand buildLockObjectForStaticMethod(NormalMethod nm) {
Class<?> klass = nm.getDeclaringClass().getClassForType();
Offset offs = Offset.fromIntSignExtend(Statics.findOrCreateObjectLiteral(klass));
Operand expectedLockObject = new ClassConstantOperand(klass, offs);
return expectedLockObject;
}
use of org.vmmagic.unboxed.Offset in project JikesRVM by JikesRVM.
the class Memory method arraycopy64Bit.
/**
* Low level copy of <code>len</code> elements from <code>src[srcPos]</code> to <code>dst[dstPos]</code>.
* <p>
* Assumption: <code>src != dst || (srcPos >= dstPos)</code> and element size is 8 bytes.
*
* @param src the source array
* @param srcIdx index in the source array to begin copy
* @param dst the destination array
* @param dstIdx index in the destination array to being copy
* @param len number of array elements to copy
*/
public static void arraycopy64Bit(Object src, int srcIdx, Object dst, int dstIdx, int len) {
Offset srcOffset = Offset.fromIntZeroExtend(srcIdx << LOG_BYTES_IN_DOUBLE);
Offset dstOffset = Offset.fromIntZeroExtend(dstIdx << LOG_BYTES_IN_DOUBLE);
int copyBytes = len << LOG_BYTES_IN_DOUBLE;
aligned64Copy(Magic.objectAsAddress(dst).plus(dstOffset), Magic.objectAsAddress(src).plus(srcOffset), copyBytes);
}
Aggregations