Search in sources :

Example 66 with Offset

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;
}
Also used : Offset(org.vmmagic.unboxed.Offset)

Example 67 with Offset

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;
}
Also used : Offset(org.vmmagic.unboxed.Offset)

Example 68 with Offset

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;
    }
}
Also used : Offset(org.vmmagic.unboxed.Offset)

Example 69 with Offset

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;
}
Also used : ClassConstantOperand(org.jikesrvm.compilers.opt.ir.operand.ClassConstantOperand) MethodOperand(org.jikesrvm.compilers.opt.ir.operand.MethodOperand) TypeOperand(org.jikesrvm.compilers.opt.ir.operand.TypeOperand) RegisterOperand(org.jikesrvm.compilers.opt.ir.operand.RegisterOperand) TrueGuardOperand(org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand) Operand(org.jikesrvm.compilers.opt.ir.operand.Operand) ObjectConstantOperand(org.jikesrvm.compilers.opt.ir.operand.ObjectConstantOperand) ClassConstantOperand(org.jikesrvm.compilers.opt.ir.operand.ClassConstantOperand) Offset(org.vmmagic.unboxed.Offset)

Example 70 with Offset

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 &gt;= 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);
}
Also used : Offset(org.vmmagic.unboxed.Offset)

Aggregations

Offset (org.vmmagic.unboxed.Offset)215 Address (org.vmmagic.unboxed.Address)48 Inline (org.vmmagic.pragma.Inline)38 Entrypoint (org.vmmagic.pragma.Entrypoint)32 ObjectReference (org.vmmagic.unboxed.ObjectReference)21 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)20 TypeReference (org.jikesrvm.classloader.TypeReference)17 RVMField (org.jikesrvm.classloader.RVMField)14 ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)13 OptCompiledMethod (org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)13 NoInline (org.vmmagic.pragma.NoInline)13 RVMMethod (org.jikesrvm.classloader.RVMMethod)11 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)10 Word (org.vmmagic.unboxed.Word)10 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)9 IntConstantOperand (org.jikesrvm.compilers.opt.ir.operand.IntConstantOperand)9 RVMType (org.jikesrvm.classloader.RVMType)8 Register (org.jikesrvm.compilers.opt.ir.Register)8 RVMClass (org.jikesrvm.classloader.RVMClass)7 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)7