use of com.ibm.j9ddr.vm29.pointer.generated.J9SharedInvariantInternTablePointer in project openj9 by eclipse.
the class WalkInternTableCommand method printSharedTableStructure.
/**
* typedef struct J9SharedInvariantInternTable {
* UDATA (*performNodeAction)(struct J9SharedInvariantInternTable *sharedInvariantInternTable, struct J9SharedInternSRPHashTableEntry *node, UDATA action, void* userData);
* UDATA flags;
* omrthread_monitor_t *tableInternFxMutex;
* struct J9SRPHashTable* sharedInvariantSRPHashtable;
* struct J9SharedInternSRPHashTableEntry* headNode;
* struct J9SharedInternSRPHashTableEntry* tailNode;
* J9SRP* sharedTailNodePtr;
* J9SRP* sharedHeadNodePtr;
* U_32* totalSharedNodesPtr;
* U_32* totalSharedWeightPtr;
* struct J9ClassLoader* systemClassLoader;
*} J9SharedInvariantInternTable;
*
* typedef struct J9SRPHashTable {
* const char* tableName;
* struct J9SRPHashTableInternal* srpHashtableInternal;
* UDATA (*hashFn)(void *key, void *userData);
* UDATA (*hashEqualFn)(void *existingEntry,void *key, void *userData);
* void (*printFn)(J9PortLibrary *portLibrary, void *key, void *userData);
* struct J9PortLibrary* portLibrary;
* void* functionUserData;
* UDATA flags;
* } J9SRPHashTable;
*
* typedef struct J9SRPHashTableInternal {
* U_32 tableSize;
* U_32 numberOfNodes;
* U_32 entrySize;
* U_32 nodeSize;
* U_32 flags;
* J9SRP nodes;
* J9SRP nodePool;
* } J9SRPHashTableInternal;
*
* Prints the info for three VM structures that are shown above and used for shared intern table.
* 1. J9SharedInvariantInternTable
* 2. J9SRPHashTable
* 3. J9SRPHashTableInternal
*
* @param out PrintStream
* @throws CorruptDataException
* @return void
*/
private void printSharedTableStructure(PrintStream out) throws CorruptDataException {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9SharedInvariantInternTablePointer sharedInternTable;
sharedInternTable = vm.sharedInvariantInternTable();
if (!sharedInternTable.isNull()) {
out.println(sharedInternTable.formatFullInteractive());
}
out.append("Total Shared Weight : " + sharedInternTable.totalSharedWeightPtr().at(0).longValue() + nl);
J9SRPHashTablePointer srphashtable = sharedInternTable.sharedInvariantSRPHashtable();
if (!srphashtable.isNull()) {
out.println(srphashtable.formatFullInteractive());
}
J9SRPHashTableInternalPointer srpHashTableInternal = srphashtable.srpHashtableInternal();
if (!srpHashTableInternal.isNull()) {
out.println(srpHashTableInternal.formatFullInteractive());
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9SharedInvariantInternTablePointer 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);
}
}
Aggregations