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

Parallel: Tighten ParallelCompactData::initialize_region_data

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • gc
    • b18

      In `ParallelCompactData::initialize_region_data`:

      ```
      const size_t count = (region_size + RegionSizeOffsetMask) >> Log2RegionSize;
      ```

      The `+ RegionSizeOffsetMask` part is to account for `region_size` being unaligned. However, in the sole caller of this method, the alignment is already asserted.

      ```
        assert((region_size & RegionSizeOffsetMask) == 0,
               "region size not a multiple of RegionSize");
      ```

      Drop the unnecessary adjustment and move the assertion inside the method as a precondition.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: