use of com.ibm.j9ddr.vm29.pointer.generated.OMRMemCategoryPointer 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);
}
}
}
}
Aggregations