G1: Remove redundant card/heap-address transition

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 19
    • Affects Version/s: 19
    • Component/s: 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;
      ```

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

              Created:
              Updated:
              Resolved: