Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8340102

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • hotspot
    • b16

      Found this papercut when looking at Leyden perf runs.

      In OopMapSort::sort, there is a loop that apparently is only there for asserts: https://github.com/openjdk/jdk/blob/0c36177fead8b64a4cee9da3c895e3799f8ba231/src/hotspot/share/compiler/oopMap.cpp#L249-L252

      At least GCC 11.4 apparently not smart enough to eliminate the whole loop in release builds. Wrapping the loop with #ifdef ASSERT saves about 144 bytes in code stream.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: