RFR: 8373615: Improve HotSpot debug functions findclass() and findmethod
Matias Saavedra Silva
matsaave at openjdk.org
Fri Dec 12 19:37:52 UTC 2025
On Fri, 12 Dec 2025 16:40:24 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> I used the `findclass` and `findmethod` functions in debug.cpp a lot when debugging problems with class metadata.
>
> https://github.com/openjdk/jdk/blob/6ec36d348b1eaeedb993a905e42650242fac0918/src/hotspot/share/utilities/debug.cpp#L583-L603
>
> This REF improves these functions by:
>
> - Sorting the names of classes and methods
> - Allow "." to be used in class names. So both `findclass("java.lang.Object")` and `findclass("java/lang/Object")` would work
> - Print the C++/Java objects that represent classes and methods.
Looks good, thanks for updating this tool! I have one nit below but otherwise this looks great
src/hotspot/share/classfile/classPrinter.cpp line 111:
> 109: }
> 110:
> 111: static int compare_klasses_alphadetically(InstanceKlass** a, InstanceKlass** b) {
Typo here:
alphadetically -> alphabetically
You might even want to use alphanumerically or even just "by name" as klasses can have numbers or other characters in their name.
-------------
Marked as reviewed by matsaave (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28796#pullrequestreview-3572745279
PR Review Comment: https://git.openjdk.org/jdk/pull/28796#discussion_r2614920850
More information about the hotspot-runtime-dev
mailing list