Search in sources :

Example 1 with J9SharedInternSRPHashTableEntryPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9SharedInternSRPHashTableEntryPointer in project openj9 by eclipse.

the class WalkInternTableCommand method walkSharedTable.

/**
 * Walks through the shared string intern table nodes and prints the info about them on each line.
 * @param out
 * @throws CorruptDataException
 * @return void
 */
private void walkSharedTable(PrintStream out) throws CorruptDataException {
    int totalWeight = 0;
    J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
    J9SharedInvariantInternTablePointer sharedInternTable = vm.sharedInvariantInternTable();
    /* Check if there is sharedInternTable before to go further */
    if (!sharedInternTable.isNull()) {
        J9SharedInternSRPHashTableEntryPointer currentEntry = sharedInternTable.headNode();
        int counter = 1;
        out.append("=================================================================================" + nl);
        out.append(tab(2) + "WALKING SHARED INTERN SRP HASHTABLE (SRPHashTable " + sharedInternTable.sharedInvariantSRPHashtable().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 (!currentEntry.isNull()) {
            out.append(counter + "." + tab + "Shared Table Entry < !J9SharedInternSRPHashTableEntry " + currentEntry.getHexAddress() + " Flags: " + currentEntry.flags().getHexValue() + " IWeight: " + currentEntry.internWeight().longValue() + " IsUTF8Shared: " + currentEntry.flags().allBitsIn(J9SharedInternSRPHashTableEntry.STRINGINTERNTABLES_NODE_FLAG_UTF8_IS_SHARED) + ">" + tab + "UTF8 <Add: " + currentEntry.utf8SRP().getHexAddress() + " Data: \"" + J9UTF8Helper.stringValue(currentEntry.utf8SRP()) + "\">" + nl);
            totalWeight += currentEntry.internWeight().longValue();
            currentEntry = currentEntry.nextNode();
            counter++;
        }
        out.append("Total Weight = " + totalWeight + nl);
        out.append("=================================================================================" + nl);
        out.append(tab(2) + "WALKING SHARED INTERN SRP HASHTABLE COMPLETED" + nl);
        out.append("=================================================================================" + nl);
    }
}
Also used : J9SharedInvariantInternTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9SharedInvariantInternTablePointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) J9SharedInternSRPHashTableEntryPointer(com.ibm.j9ddr.vm29.pointer.generated.J9SharedInternSRPHashTableEntryPointer)

Aggregations

J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)1 J9SharedInternSRPHashTableEntryPointer (com.ibm.j9ddr.vm29.pointer.generated.J9SharedInternSRPHashTableEntryPointer)1 J9SharedInvariantInternTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9SharedInvariantInternTablePointer)1