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

Fei Yang fyang at openjdk.org
Fri Sep 13 11:00:04 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.

LGTM.

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

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20992#pullrequestreview-2302817493


More information about the hotspot-compiler-dev mailing list