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

G1: Remove duplicate assertions in HeapRegion::oops_on_memregion_seq_iterate_careful

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • hotspot
    • gc
    • b15

      In `HeapRegion::oops_on_memregion_seq_iterate_careful`:
      ```
        HeapWord* cur = block_start(start);
        ...
        {
          assert(cur <= start,
                 "cur: " PTR_FORMAT ", start: " PTR_FORMAT, p2i(cur), p2i(start));
          HeapWord* next = cur + block_size(cur);
          assert(start < next,
                 "start: " PTR_FORMAT ", next: " PTR_FORMAT, p2i(start), p2i(next));
        }
      ```
      Those assertions are checking postconditions of `block_start` (after JDK-8283332).

      However, the same checkings are already done inside `block_start(...)`.

      ```
        assert(q <= addr, "wrong order for q and addr");
        assert(addr < n, "wrong order for addr and n");
      ```

      Remove the duplicate assertions in the caller.

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

              Created:
              Updated:
              Resolved: