JDK-8327246: changes as per @kwalls last comments, improved help and optimized -location option checking

This commit is contained in:
Larry Cable 2026-01-27 12:31:22 -08:00
parent 341643a2d7
commit f2198458b0
2 changed files with 17 additions and 15 deletions

View File

@ -2375,12 +2375,14 @@ void PrintClassClosure::do_klass(Klass* k) {
if (ik->in_aot_cache()) { if (ik->in_aot_cache()) {
buf[i++] = 'S'; buf[i++] = 'S';
if (AOTMetaspace::in_aot_cache_static_region((void*)k)) { if (_location) {
_aot_statics++; if (AOTMetaspace::in_aot_cache_static_region((void*)k)) {
if (_location) buf[i++] = 's'; _aot_statics++;
} else if (AOTMetaspace::in_aot_cache_dynamic_region((void*)k)) { buf[i++] = 's';
_aot_dynamics++; } else if (AOTMetaspace::in_aot_cache_dynamic_region((void*)k)) {
if (_location) buf[i++] = 'd'; _aot_dynamics++;
buf[i++] = 'd';
}
} }
} }
} }

View File

@ -951,16 +951,16 @@ void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
ClassesDCmd::ClassesDCmd(outputStream* output, bool heap) : ClassesDCmd::ClassesDCmd(outputStream* output, bool heap) :
DCmdWithParser(output, heap), DCmdWithParser(output, heap),
_verbose("-verbose", _verbose("-verbose",
"Dump the detailed content of a Java class. " "Dump the detailed content of a Java class.\n"
"Some classes are annotated with flags: " "\t\tclasses are annotated with flags:\n"
"F = has, or inherits, a non-empty finalize method, " "\t\tF = has, or inherits, a non-empty finalize method,\n"
"f = has final method, " "\t\tf = has final method,\n"
"W = methods rewritten, " "\t\tW = methods rewritten,\n"
"C = marked with @Contended annotation, " "\t\tC = marked with @Contended annotation,\n"
"R = has been redefined, " "\t\tR = has been redefined,\n"
"S = is shared class (if -location then 's' indicates static 'd' indicates dynamic AOT cache)", "\t\tS = is an (App)CDS shared class (if -location is also specified, (either) 's' indicating static (or) 'd' indicating dynamic AOT cache locations, are appended)",
"BOOLEAN", false, "false"), "BOOLEAN", false, "false"),
_location("-location", "Print class file (and AOT cache) location url (if available)", "BOOLEAN", false, "false") { _location("-location", "Print class file location url (if available)", "BOOLEAN", false, "false") {
_dcmdparser.add_dcmd_option(&_verbose); _dcmdparser.add_dcmd_option(&_verbose);
_dcmdparser.add_dcmd_option(&_location); _dcmdparser.add_dcmd_option(&_location);
} }