From f2198458b079f11bbc838162f737f4f820e64f96 Mon Sep 17 00:00:00 2001 From: Larry Cable Date: Tue, 27 Jan 2026 12:31:22 -0800 Subject: [PATCH] JDK-8327246: changes as per @kwalls last comments, improved help and optimized -location option checking --- src/hotspot/share/oops/instanceKlass.cpp | 14 ++++++++------ .../share/services/diagnosticCommand.cpp | 18 +++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 923ee8e2715..80f9b06474f 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -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'; + } } } } diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index f098435a763..697567d7371 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -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); }