RFR: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph [v2]

David Holmes dholmes at openjdk.java.net
Tue Apr 6 03:13:25 UTC 2021


On Tue, 6 Apr 2021 02:29:28 GMT, Yi Yang <yyang at openjdk.org> wrote:

>> src/hotspot/share/oops/method.cpp line 2260:
>> 
>>> 2258: void Method::print_jmethod_ids(const ClassLoaderData* loader_data, outputStream* out) {
>>> 2259:   out->print("%d", loader_data->jmethod_ids()->count_methods());
>>> 2260: }
>> 
>> This method is pointless if it only prints the count to the stream without any descriptive text. Just delete it and print the method count directly in the caller.
>
> The type of jmethod_ids  is JNIMethodBlock, which is declared in `method.cpp`, we have to access its internal fields via print_jmethod_ids that declared in `method.hpp`.  But if we only want to show jmethod_ids's address, then we can remove Method::print_jmethod_ids and print it directly. I'm not sure if others think jmethod_ids._count is important for their debugging, so I keep unchanged :)

Sorry I don't see your point. I am suggesting that this:

out->print   (" - jmethod count       ");
Method::print_jmethod_ids(this, out);
out->print_cr("");

be replaced by:

out->print_cr(" - jmethod count       %d", this->jmethod_ids()->count_methods());

-------------

PR: https://git.openjdk.java.net/jdk/pull/3323


More information about the hotspot-dev mailing list