use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class J9MemTagHelper method j9mem_get_footer_padding.
/**
* Given the address of the headerEyecatcher for the memory block, return
* the address of the footer padding.
*
* Note that there not be any padding, in which case this returns the same
* as @ref j9mem_get_footer_tag(), the address of the footer tag.
*
* @throws CorruptDataException
*/
public static VoidPointer j9mem_get_footer_padding(J9MemTagPointer headerEyeCatcherAddress) throws CorruptDataException {
UDATA cursor = UDATA.cast(U8Pointer.cast(headerEyeCatcherAddress).add(J9MemTag.SIZEOF));
U8Pointer padding = U8Pointer.cast(cursor.add(headerEyeCatcherAddress.allocSize()));
return VoidPointer.cast(padding);
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class LinearDumper method groupSectionByName.
/**
* Find the first and the last section and group them in another section with the same name ending with a "s".
* For example, it will group all of the methodDebugInfo in a section named methodDebugInfos
* It is important to note that the function does not check if the sections grouped are contiguous, it will
* group all sections between the first and the last section even if their names doesn't match.
*
* @param clazz
* @param name name of sections to group
* @param computePadding
* @throws CorruptDataException
*/
private void groupSectionByName(final StructurePointer clazz, String name, boolean computePadding) throws CorruptDataException {
AbstractPointer firstMethodDebugInfo = null;
AbstractPointer lastMethodDebugInfo = null;
for (J9ClassRegion region : classRegions) {
if (SlotType.J9_SECTION_START == region.getType() && region.getName().equals(name)) {
if (firstMethodDebugInfo == null || region.getSlotPtr().lt(firstMethodDebugInfo)) {
firstMethodDebugInfo = region.getSlotPtr();
}
if (lastMethodDebugInfo == null || region.getSlotPtr().add(region.getLength()).gt(lastMethodDebugInfo)) {
lastMethodDebugInfo = region.getSlotPtr().addOffset(region.getLength());
}
}
}
if (firstMethodDebugInfo != null && lastMethodDebugInfo != null) {
UDATA length = UDATA.cast(lastMethodDebugInfo).sub(UDATA.cast(firstMethodDebugInfo));
addSection(clazz, PointerPointer.cast(firstMethodDebugInfo), length.longValue(), name + "s", computePadding);
}
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class RamClassWalker method allSlotsInRAMSuperClassesDo.
private void allSlotsInRAMSuperClassesDo() throws CorruptDataException {
/* The classDepth represent the number of superclasses */
final long classDepth = J9ClassHelper.classDepth(ramClass).longValue();
/*
* The superclasses is an array, ramClass.superclasses() points to the
* head and we get the next superclasses by moving the pointer.
* superclasses.add(i) adds sizeof(UDATA) to the value of the
* superclass'pointer
*/
final PointerPointer superclasses = ramClass.superclasses();
for (int i = 0; i < classDepth; i++) {
classWalkerCallback.addSlot(clazz, SlotType.J9_UDATA, superclasses.add(i), "SuperClass address", "!j9class");
}
classWalkerCallback.addSection(clazz, superclasses, classDepth * PointerPointer.SIZEOF, "Superclasses", false);
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class J9ROMFieldShapeHelper method romFieldSizeOf.
public static UDATA romFieldSizeOf(J9ROMFieldShapePointer fieldShapePointer) throws CorruptDataException {
long size = J9ROMFieldShape.SIZEOF;
U32 modifiers = fieldShapePointer.modifiers();
if ((modifiers.anyBitsIn(J9FieldFlagConstant))) {
size += ((modifiers.allBitsIn(J9FieldSizeDouble)) ? U64.SIZEOF : U32.SIZEOF);
}
if (modifiers.anyBitsIn(J9FieldFlagHasGenericSignature)) {
size += U32.SIZEOF;
}
if (modifiers.anyBitsIn(J9FieldFlagHasFieldAnnotations)) {
long bytesToPad = 0;
// long annotationSize = U32Pointer.cast(address + size).at(0).longValue();
long annotationSize = U32Pointer.cast(fieldShapePointer.addOffset(size)).at(0).longValue();
/* add the length of annotation data */
size += annotationSize;
/* add the size of the size of the annotation data */
size += U32.SIZEOF;
bytesToPad = U32.SIZEOF - (annotationSize % U32.SIZEOF);
if (U32.SIZEOF == bytesToPad) {
bytesToPad = 0;
}
/* add the padding */
size += bytesToPad;
}
if (modifiers.anyBitsIn(J9FieldFlagHasTypeAnnotations)) {
long bytesToPad = 0;
long annotationSize = U32Pointer.cast(fieldShapePointer.addOffset(size)).at(0).longValue();
/* add the length of annotation data */
size += annotationSize;
/* add the size of the size of the annotation data */
size += U32.SIZEOF;
bytesToPad = U32.SIZEOF - (annotationSize % U32.SIZEOF);
if (U32.SIZEOF == bytesToPad) {
bytesToPad = 0;
}
/* add the padding */
size += bytesToPad;
}
return new UDATA(size);
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class ByteCodeDumper method dumpBytecodes.
public static IDATA dumpBytecodes(PrintStream out, J9ROMClassPointer romClass, J9ROMMethodPointer romMethod, U32 flags) throws Exception {
U16 temp;
UDATA length;
out.append(String.format(" Argument Count: %d", romMethod.argCount().intValue()));
out.append(nl);
temp = romMethod.tempCount();
out.append(String.format(" Temp Count: %d", temp.intValue()));
out.append(nl);
out.append(nl);
length = ROMHelp.J9_BYTECODE_SIZE_FROM_ROM_METHOD(romMethod);
if (length.eq(0)) {
return new IDATA(BCT_ERR_NO_ERROR);
/* catch abstract methods */
}
return j9bcutil_dumpBytecodes(out, romClass, ROMHelp.J9_BYTECODE_START_FROM_ROM_METHOD(romMethod), new UDATA(0), length.sub(1), flags, "");
}
Aggregations