RFR: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph [v3]
Yi Yang
yyang at openjdk.java.net
Wed Apr 7 06:48:54 UTC 2021
On Wed, 7 Apr 2021 05:27:41 GMT, Yi Yang <yyang at openjdk.org> wrote:
>> src/hotspot/share/classfile/classLoaderData.cpp line 952:
>>
>>> 950: out->print_cr("");
>>> 951: }
>>> 952: out->print_cr(" - class loader " PTR_FORMAT, p2i(_class_loader.ptr_raw()));
>>
>> I'm surprised the p2i's were added. If the values are pointers then p2i should not be needed. If using p2i then INTPTR_FORMAT is the correct format specifier to use.
>
> I'm not sure the original intentions of these two macros. It looks like the definitions of PRT_FORMAT and INTPTR_FORMAT are identical:
>
> https://github.com/openjdk/jdk/blob/c3abdc9aadc734053dbcc43d5294d5f16a0b0ce3/src/hotspot/share/utilities/globalDefinitions.hpp#L129-L132
>
> Also I find many occurrences that using p2i while format specifier is PRT_FORMAT. If this is indeed wrong, I may fix them later.
Even if a pointer is given, p2i is necessary for PRT_FORMAT and INTPTR_FORMAT specifier, the compiler will throw errors without p2i.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3323
More information about the hotspot-dev
mailing list