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

G1: Remove redundant card/heap-address transition

XMLWordPrintable

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

      In `G1BlockOffsetTablePart::update_for_block_work`:

      ```
      size_t end_index = _bot->index_for(blk_end - 1);

      HeapWord* rem_st = _bot->address_for_index(index + 1);
      HeapWord* rem_end = _bot->address_for_index(end_index) + BOTConstants::card_size_in_words();

      ...

      // start == rem_st
      // end == rem_end

      size_t start_card = _bot->index_for(start);
      size_t end_card = _bot->index_for(end-1);
      ```

      It's essentially the following, because `address_for_index` and `index_for` are inverse functions of each other.

      ```
      size_t start_card = index + 1;
      size_t end_card = end_index;
      ```

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

              Created:
              Updated:
              Resolved: