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

Fix code style issues in space.inline.hpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 9
    • hotspot
    • gc

      In recent changes in JDK-8073321 the shared code for full gc has been cleaned up a bit.

      There is still opportunity to improve the code further:

      - braces after "if" in CompactibleSpace::clear_empty_region

      - in CompactibleSpace::scan_and_compact, space->_first_dead can be extracted into a local variable instead of repeated access. Other methods repeatedly read the same variable (like CompactibleSpace::verify_up_to_first_dead) too. Not so much because of performance, but it makes the code easier to read.

      - instead of space->bottom(), cur_obj could(!) be used to tighten the code further. There are arguments against it, but it should be thought about again.

      All this would tighten the code a bit, making it more readable.

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: