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

Tighten G1 G1BlockOffsetTable::block_start() code

    XMLWordPrintable

Details

    • gc

    Description

      Since JDK-8276098 the BOT for G1 is always precise and accurate at least for old gen regions.

      Still, G1BlockOffsetTablePart::block_start, even after getting the BOT table element value, tries to make sure that the object it found crosses into the card we want to find.

      This involves getting block size and eventually looping to advance the current position so that we get to a block crossing the card.

      This seems unnecessary if the address we ask the block start for is card-aligned as the BOT is always precise and accurate at least for old gen regions.
      For refinement, the address is aligned 100% of times; some testing showed that in card scanning this is 99%+ of times the case as a non-card aligned address would need e.g. objects that span multiple cards which is (as the statistics show) really rare.

      Similarly the documentation for G1BlockOffsetTable::block_start() seems outdated.

      See if the code can be simplified given these new constraints for some (minor) performance gain.

      Attachments

        Issue Links

          Activity

            People

              tschatzl Thomas Schatzl
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: