On Fri, 19 Dec 2025 06:43:05 GMT, Hao Sun <[email protected]> wrote:
> `get_source(const AOTClassLocation* cl, JavaThread* jt)` is only used by
> `JfrClassDefineEvent::on_restoration()` within an `INCLUDE_CDS` guard.
>
> Add the same `INCLUDE_CDS` guard to mitigate the GCC warning.
>
> Tests: JDK build with CDS disabled passed on both x86_64 and aarch64.
> tier1~3 passed on both x86_64 and aarch64.
Changes requested by mgronlun (Reviewer).
src/hotspot/share/jfr/support/jfrClassDefineEvent.cpp line 129:
> 127:
> 128: #if INCLUDE_CDS
> 129: static traceid get_source(const AOTClassLocation* cl, JavaThread* jt) {
You can just move down this static helper routine and put it before line 177;
then no new conditionals needs to be introduced.
-------------
PR Review: https://git.openjdk.org/jdk/pull/28917#pullrequestreview-3601700892
PR Review Comment: https://git.openjdk.org/jdk/pull/28917#discussion_r2637817002