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

Improve G1CardSetInlinePtr::add()

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 18
    • 18
    • hotspot
    • gc
    • b11

    Description

      Currently the method to add entries to the inline pointers is somewhat inefficient:

        // Check if the card is already stored in the pointer.
        if (contains(card_idx, bits_per_card)) {
          return Found;
        }
        // Check if there is actually enough space.
        if (card_pos_for(num_elems + 1, bits_per_card) >= BitsInValue) {
          return Overflow;
        }

      I.e. contains() could actually return how many elements are already in the card set container.
      Also, in the cmpxchg loop we start work looking for whether the element is already stored in there always from the beginning. That's not necessary, there is no overwriting of already inserted values in the inline pointer, only the recently added ones need to be looked at again.

      Improve this.

      Attachments

        Issue Links

          Activity

            People

              iwalulya Ivan Walulya
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: