RFR: 8340102: Move assert-only loop in OopMapSort::sort under debug macro

Aleksey Shipilev shade at openjdk.org
Mon Sep 16 05:35:15 UTC 2024


On Fri, 13 Sep 2024 10:04:01 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Found this papercut when looking at Leyden perf runs.
> 
> In OopMapSort::sort, there is a loop that apparently is only there for asserts. At least GCC 11.4 apparently not smart enough to eliminate the whole loop in release builds, probably because iterator reads things from the stream. Wrapping the loop with #ifdef ASSERT saves about 144 bytes in code stream.

Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/20992#issuecomment-2352045821


More information about the hotspot-compiler-dev mailing list