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();
}
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();
}
}
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());
}
}
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();
}
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);
}
Aggregations