use of com.ibm.j9ddr.vm29.pointer.generated.J9InternHashTableEntryPointer in project openj9 by eclipse.
the class VmCheckCommand method checkLocalInternTableSanity.
/*
* Based on vmchk/checkinterntable.c r1.3
*
* J9LocalInternTableSanity sanity:
* if J9JavaVM->dynamicLoadBuffers != NULL
* invariantInternTree check:
* For each J9InternHashTableEntry
* Ensure J9InternHashTableEntry->utf8 is valid
* Ensure J9InternHashTableEntry->classLoader is valid
*/
private void checkLocalInternTableSanity(J9JavaVMPointer vm, PrintStream out) throws CorruptDataException {
int count = 0;
reportMessage(out, "Checking ROM intern string nodes");
J9TranslationBufferSetPointer dynamicLoadBuffers = vm.dynamicLoadBuffers();
if (!dynamicLoadBuffers.isNull()) {
J9DbgROMClassBuilderPointer romClassBuilder = J9DbgROMClassBuilderPointer.cast(dynamicLoadBuffers.romClassBuilder());
J9DbgStringInternTablePointer stringInternTable = romClassBuilder.stringInternTable();
J9InternHashTableEntryPointer node = stringInternTable.headNode();
while (!node.isNull()) {
J9UTF8Pointer utf8 = node.utf8();
J9ClassLoaderPointer classLoader = node.classLoader();
if (!verifyUTF8(utf8)) {
reportError(out, "invalid utf8=0x%s for node=0x%s", Long.toHexString(utf8.getAddress()), Long.toHexString(node.getAddress()));
}
if (!verifyJ9ClassLoader(vm, classLoader)) {
reportError(out, "invalid classLoader=0x%s for node=0x%s", Long.toHexString(classLoader.getAddress()), Long.toHexString(node.getAddress()));
}
count++;
node = node.nextNode();
}
}
reportMessage(out, "Checking %d ROM intern string nodes done", count);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9InternHashTableEntryPointer in project openj9 by eclipse.
the class WalkInternTableCommand method walkLocalTable.
/**
* Walks through the local string intern table nodes and prints the info about them on each line.
* @param out
* @throws CorruptDataException
* @return void
*/
private void walkLocalTable(PrintStream out) throws CorruptDataException {
int totalWeight = 0;
J9DbgStringInternTablePointer stringInternTablePtr = getRomClassBuilderPtr(out);
if (stringInternTablePtr.isNull()) {
out.append("StringInternTable is null" + nl);
return;
}
J9InternHashTableEntryPointer currentEntryPtr = stringInternTablePtr.headNode();
if (currentEntryPtr.isNull()) {
out.append("HeadNode is null" + nl);
return;
}
int counter = 1;
out.append("=================================================================================" + nl);
out.append(tab(2) + "WALKING LOCAL INTERN HASHTABLE (stringInternTable )" + stringInternTablePtr.getHexAddress() + ")" + nl);
out.append(tab(2) + "FROM: MRU (MOST RECENTLY USED)" + nl);
out.append(tab(2) + "TO: LRU (LEAST RECENTLY USED)" + nl);
out.append("=================================================================================" + nl);
while (!currentEntryPtr.isNull()) {
out.append(counter + "." + tab + "Local Table Entry < !J9InternHashTableEntry " + currentEntryPtr.getHexAddress() + " Flags: " + currentEntryPtr.flags().getHexValue() + " IWeight: " + currentEntryPtr.internWeight().longValue() + " ClassLoader: " + "!J9ClassLoader " + currentEntryPtr.classLoader().getHexAddress() + ">" + tab + "UTF8 <Add: " + currentEntryPtr.utf8().getHexAddress() + " Data: \"" + J9UTF8Helper.stringValue(currentEntryPtr.utf8()) + "\">" + nl);
totalWeight += currentEntryPtr.internWeight().longValue();
currentEntryPtr = currentEntryPtr.nextNode();
counter++;
}
out.append("Total Weight = " + totalWeight + nl);
out.append("=================================================================================" + nl);
out.append(tab(2) + "WALKING LOCAL INTERN HASHTABLE COMPLETED" + nl);
out.append("=================================================================================" + nl);
}
Aggregations