use of com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer in project openj9 by eclipse.
the class GCArrayletObjectModel_V1 method getTotalFootprintInBytesWithHeader.
@Override
public UDATA getTotalFootprintInBytesWithHeader(J9IndexableObjectPointer arrayPtr) throws CorruptDataException {
UDATA spineSize = getSizeInBytesWithHeader(arrayPtr);
UDATA externalArrayletSize = externalArrayletsSize(arrayPtr);
UDATA totalFootprint = spineSize.add(externalArrayletSize);
return totalFootprint;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer in project openj9 by eclipse.
the class GCArrayletObjectModelBase_V1 method getHashcodeOffset.
@Override
public UDATA getHashcodeOffset(J9IndexableObjectPointer array) throws CorruptDataException {
// Don't call getDataSizeInBytes() since that rounds up to UDATA.
long layout = getArrayLayout(array);
J9ArrayClassPointer clazz = J9IndexableObjectHelper.clazz(array);
U32 arrayShape = J9ROMArrayClassPointer.cast(clazz.romClass()).arrayShape();
UDATA numberOfElements = getSizeInElements(array);
UDATA dataSize = numberOfElements.leftShift(arrayShape.bitAnd(0x0000FFFF).intValue());
UDATA numberArraylets = numArraylets(dataSize);
boolean alignData = shouldAlignSpineDataSection(clazz);
UDATA spineSize = getSpineSize(layout, numberArraylets, dataSize, alignData);
return U32.roundToSizeofU32(spineSize);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer in project openj9 by eclipse.
the class GCContiguousArrayObjectModel_V1 method getHashcodeOffset.
public UDATA getHashcodeOffset(J9IndexableObjectPointer array) throws CorruptDataException {
J9ArrayClassPointer clazz = J9IndexableObjectHelper.clazz(array);
UDATA numberOfElements = getSizeInElements(array);
J9ROMArrayClassPointer romArrayClass = J9ROMArrayClassPointer.cast(clazz.romClass());
UDATA size = numberOfElements.leftShift(romArrayClass.arrayShape().bitAnd(0xFFFF).intValue());
size = size.add(J9IndexableObjectContiguous.SIZEOF);
return UDATA.roundToSizeofU32(size);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer in project openj9 by eclipse.
the class J9IndexableObjectHelper method getDataAsString.
public static String getDataAsString(J9IndexableObjectPointer array, int dumpLimit, int characterDumpLimit) throws CorruptDataException {
StringWriter buf = new StringWriter();
J9ClassPointer clazz = J9ObjectHelper.clazz(J9ObjectPointer.cast(array));
char typeChar = J9ClassHelper.getName(clazz).charAt(1);
int length = J9IndexableObjectHelper.size(array).intValue();
int limit = 0;
if (typeChar != 'C') {
limit = dumpLimit;
} else {
limit = characterDumpLimit;
}
buf.write("{ ");
int i;
for (i = 0; i < Math.min(length, limit); i++) {
Object data = J9IndexableObjectHelper.getData(array);
switch(typeChar) {
case 'B':
buf.write("0x");
buf.write(Integer.toHexString(((byte[]) data)[i]));
break;
case 'C':
char ch = ((char[]) data)[i];
if (ch > 31 && ch < 127) {
buf.write(ch);
} else {
buf.write('?');
}
break;
case 'D':
buf.write(Double.toString(((double[]) data)[i]));
break;
case 'F':
buf.write(Float.toString(((float[]) data)[i]));
break;
case 'I':
buf.write("0x");
buf.write(Integer.toHexString(((int[]) data)[i]));
break;
case 'J':
buf.write("0x");
buf.write(Long.toHexString(((long[]) data)[i]));
break;
case 'S':
buf.write("0x");
buf.write(Integer.toHexString(((short[]) data)[i]));
break;
case 'Z':
buf.write(((boolean[]) data)[i] ? "true" : "false");
break;
case 'L':
case '[':
{
J9ObjectPointer item = ((J9ObjectPointer[]) data)[i];
if (null == item) {
buf.write("null");
} else {
buf.write("0x");
buf.write(Long.toHexString(item.longValue()));
}
break;
}
default:
buf.write("?");
}
if (typeChar != 'C' && (i != length - 1)) {
/* We aren't printing out a character and we aren't the last element */
buf.write(", ");
}
}
if (i != length) {
/* We hit the limit */
buf.write("... ");
}
buf.write(" }");
return buf.toString();
}
Aggregations