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()) {
buf[i++] = 'S';
if (AOTMetaspace::in_aot_cache_static_region((void*)k)) {
_aot_statics++;
if (_location) buf[i++] = 's';
} else if (AOTMetaspace::in_aot_cache_dynamic_region((void*)k)) {
_aot_dynamics++;
if (_location) buf[i++] = 'd';
if (_location) {
if (AOTMetaspace::in_aot_cache_static_region((void*)k)) {
_aot_statics++;
buf[i++] = 's';
} else if (AOTMetaspace::in_aot_cache_dynamic_region((void*)k)) {
_aot_dynamics++;
buf[i++] = 'd';
}
}
}
}

View File

@ -951,16 +951,16 @@ void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
ClassesDCmd::ClassesDCmd(outputStream* output, bool heap) :
DCmdWithParser(output, heap),
_verbose("-verbose",
"Dump the detailed content of a Java class. "
"Some classes are annotated with flags: "
"F = has, or inherits, a non-empty finalize method, "
"f = has final method, "
"W = methods rewritten, "
"C = marked with @Contended annotation, "
"R = has been redefined, "
"S = is shared class (if -location then 's' indicates static 'd' indicates dynamic AOT cache)",
"Dump the detailed content of a Java class.\n"
"\t\tclasses are annotated with flags:\n"
"\t\tF = has, or inherits, a non-empty finalize method,\n"
"\t\tf = has final method,\n"
"\t\tW = methods rewritten,\n"
"\t\tC = marked with @Contended annotation,\n"
"\t\tR = has been redefined,\n"
"\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"),
_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(&_location);
}