requiredEntries.add(getRefString("")); // uconditionally present
visitRefs(VRM_PACKAGE, requiredEntries);
ConstantPool.completeReferencesIn(requiredEntries, false);
if (verbose > 1)
Utils.log.fine("Sorting CP entries");
Index cpAllU = ConstantPool.makeIndex("unsorted", requiredEntries);
Index[] byTagU = ConstantPool.partitionByTag(cpAllU);
for (int i = 0; i < ConstantPool.TAGS_IN_ORDER.length; i++) {
byte tag = ConstantPool.TAGS_IN_ORDER[i];
// Work on all entries of a given kind.
Index ix = byTagU[tag];
if (ix == null) continue;
ConstantPool.sort(ix);
cp.initIndexByTag(tag, ix);
byTagU[tag] = null; // done with it
}
for (int i = 0; i < byTagU.length; i++) {
assert(byTagU[i] == null); // all consumed
}
for (int i = 0; i < ConstantPool.TAGS_IN_ORDER.length; i++) {
byte tag = ConstantPool.TAGS_IN_ORDER[i];
Index ix = cp.getIndexByTag(tag);
assert(ix.assertIsSorted());
if (verbose > 2) Utils.log.fine(ix.dumpString());
}
}