Search in sources :

Example 51 with RVMType

use of org.jikesrvm.classloader.RVMType in project JikesRVM by JikesRVM.

the class VMClassLoader method resolveClass.

static void resolveClass(Class<?> c) {
    RVMType cls = JikesRVMSupport.getTypeForClass(c);
    cls.prepareForFirstUse();
}
Also used : RVMType(org.jikesrvm.classloader.RVMType)

Example 52 with RVMType

use of org.jikesrvm.classloader.RVMType in project JikesRVM by JikesRVM.

the class VMInstrumentationImpl method getObjectSize.

static long getObjectSize(Object objectToSize) {
    Class<?> cl = objectToSize.getClass();
    RVMType vmType = java.lang.JikesRVMSupport.getTypeForClass(cl);
    if (cl.isArray()) {
        RVMArray vmArray = (RVMArray) vmType;
        int nelements = java.lang.reflect.Array.getLength(objectToSize);
        return vmArray.getInstanceSize(nelements);
    } else {
        RVMClass vmClass = (RVMClass) vmType;
        return vmClass.getInstanceSize();
    }
}
Also used : RVMArray(org.jikesrvm.classloader.RVMArray) RVMType(org.jikesrvm.classloader.RVMType) RVMClass(org.jikesrvm.classloader.RVMClass)

Example 53 with RVMType

use of org.jikesrvm.classloader.RVMType in project JikesRVM by JikesRVM.

the class ObjectModel method getAlignWhenCopied.

@Override
public int getAlignWhenCopied(ObjectReference object) {
    TIB tib = org.jikesrvm.objectmodel.ObjectModel.getTIB(object);
    RVMType type = tib.getType();
    if (type.isArrayType()) {
        return org.jikesrvm.objectmodel.ObjectModel.getAlignment(type.asArray(), object.toObject());
    } else {
        return org.jikesrvm.objectmodel.ObjectModel.getAlignment(type.asClass(), object.toObject());
    }
}
Also used : RVMType(org.jikesrvm.classloader.RVMType) TIB(org.jikesrvm.objectmodel.TIB)

Example 54 with RVMType

use of org.jikesrvm.classloader.RVMType in project JikesRVM by JikesRVM.

the class ObjectModel method isAcyclic.

@Override
@Inline
public boolean isAcyclic(ObjectReference typeRef) {
    TIB tib = Magic.addressAsTIB(typeRef.toAddress());
    RVMType type = tib.getType();
    return type.isAcyclicReference();
}
Also used : RVMType(org.jikesrvm.classloader.RVMType) TIB(org.jikesrvm.objectmodel.TIB) Inline(org.vmmagic.pragma.Inline)

Example 55 with RVMType

use of org.jikesrvm.classloader.RVMType 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);
}
Also used : RVMType(org.jikesrvm.classloader.RVMType) TIB(org.jikesrvm.objectmodel.TIB) Inline(org.vmmagic.pragma.Inline)

Aggregations

RVMType (org.jikesrvm.classloader.RVMType)77 RVMClass (org.jikesrvm.classloader.RVMClass)23 TypeReference (org.jikesrvm.classloader.TypeReference)18 Address (org.vmmagic.unboxed.Address)16 RVMMethod (org.jikesrvm.classloader.RVMMethod)15 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)15 TIB (org.jikesrvm.objectmodel.TIB)13 Entrypoint (org.vmmagic.pragma.Entrypoint)13 IntConstantOperand (org.jikesrvm.compilers.opt.ir.operand.IntConstantOperand)12 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)12 RVMArray (org.jikesrvm.classloader.RVMArray)11 ConditionOperand (org.jikesrvm.compilers.opt.ir.operand.ConditionOperand)11 MethodOperand (org.jikesrvm.compilers.opt.ir.operand.MethodOperand)11 BranchProfileOperand (org.jikesrvm.compilers.opt.ir.operand.BranchProfileOperand)10 NullConstantOperand (org.jikesrvm.compilers.opt.ir.operand.NullConstantOperand)10 TrapCodeOperand (org.jikesrvm.compilers.opt.ir.operand.TrapCodeOperand)10 TrueGuardOperand (org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand)10 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)9 TypeOperand (org.jikesrvm.compilers.opt.ir.operand.TypeOperand)9 Offset (org.vmmagic.unboxed.Offset)8