use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class StructurePointer method getU32Bitfield.
protected U32 getU32Bitfield(int s, int b) throws CorruptDataException {
int cell = s / StructureReader.BIT_FIELD_CELL_SIZE;
U32 cellValue = new U32(getIntAtOffset(cell * StructureReader.BIT_FIELD_CELL_SIZE / 8));
int n = getStartingBit(s, b);
U32 returnValue = cellValue.leftShift(StructureReader.BIT_FIELD_CELL_SIZE - n);
returnValue = returnValue.rightShift(StructureReader.BIT_FIELD_CELL_SIZE - b);
return returnValue;
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class RomClassWalker method allSlotsInROMFieldDo.
private int allSlotsInROMFieldDo(J9ROMFieldShapePointer field) throws CorruptDataException {
int fieldLength = 0;
U32Pointer initialValue;
U32 modifiers;
J9ROMNameAndSignaturePointer fieldNAS = field.nameAndSignature();
classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, fieldNAS.nameEA(), "name");
classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, fieldNAS.signatureEA(), "signature");
classWalkerCallback.addSlot(clazz, SlotType.J9_U32, field.modifiersEA(), "modifiers");
modifiers = field.modifiers();
initialValue = U32Pointer.cast(field.add(1));
if (modifiers.anyBitsIn(J9FieldFlagConstant)) {
if (modifiers.anyBitsIn(J9FieldSizeDouble)) {
classWalkerCallback.addSlot(clazz, SlotType.J9_I64, I64Pointer.cast(initialValue), "fieldInitialValue");
initialValue = initialValue.add(2);
} else {
classWalkerCallback.addSlot(clazz, SlotType.J9_I32, initialValue, "fieldInitialValue");
initialValue = initialValue.add(1);
}
}
if (modifiers.anyBitsIn(J9FieldFlagHasGenericSignature)) {
classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, initialValue, "fieldGenSigUTF8");
initialValue = initialValue.add(1);
}
if (modifiers.allBitsIn(J9FieldFlagHasFieldAnnotations)) {
initialValue = initialValue.add(allSlotsInAnnotationDo(initialValue, "fieldAnnotation"));
}
fieldLength = (int) (initialValue.getAddress() - field.getAddress());
classWalkerCallback.addSection(clazz, field, fieldLength, "field", true);
return fieldLength;
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class OMRMemCategoryHelper method visitMemoryCategoryChildren.
/**
* Performs a depth-first walk of all the children of startNode, starting with startNode itself
* @param startNode Node to start walking from
* @param visitor Visitor object
*/
public static void visitMemoryCategoryChildren(OMRMemCategoryPointer startNode, IOMRMemCategoryVisitor visitor) throws CorruptDataException {
visitor.visit(startNode);
final int numberOfChildren = startNode.numberOfChildren().intValue();
for (int i = 0; i < numberOfChildren; i++) {
U32 childCode = startNode.children().at(i);
OMRMemCategoryPointer child = getMemoryCategory(childCode);
/* getMemoryCategory will map codes to the unknown code if necessary. If we've mapped to another category code,
* we don't want to iterate to it
*/
if (child.categoryCode().eq(childCode)) {
visitMemoryCategoryChildren(child, visitor);
} else {
U32 thisCategoryCode = null;
try {
thisCategoryCode = startNode.categoryCode();
} catch (CorruptDataException ex) {
}
if (thisCategoryCode == null) {
throw new CorruptDataException("Bad memory category child relationship. Memory Category at " + startNode.getHexAddress() + " references unknown memory category code " + childCode);
} else {
throw new CorruptDataException("Bad memory category child relationship. Memory Category at " + startNode.getHexAddress() + " code " + thisCategoryCode + " references unknown memory category code " + childCode);
}
}
}
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class J9ROMMethodHelper method hasMethodTypeAnnotations.
public static boolean hasMethodTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
boolean result = false;
if (0 != romHelpVersion) {
U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_METHOD_TYPE_ANNOTATIONS);
} else {
result = method.modifiers().allBitsIn(J9JavaAccessFlags.J9AccMethodHasTypeAnnotations);
/* J9AccMethodHasExtendedModifiers was J9AccMethodHasTypeAnnotations */
}
return result;
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class J9ROMMethodHelper method hasCodeTypeAnnotations.
public static boolean hasCodeTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
boolean result = false;
if (0 != romHelpVersion) {
U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_CODE_TYPE_ANNOTATIONS);
}
return result;
}
Aggregations