RFR: 8314276: Improve PtrQueue API around size/capacity [v2]

Kim Barrett kbarrett at openjdk.org
Thu Aug 17 05:11:57 UTC 2023


> These changes simplify some uses of PtrQueue &etc and eliminate questions
> about where buffer capacity information should be obtained from, and whether
> it is correct.
> 
> This change
> 
> (1) Adds capacity information directly to BufferNode.  This is done without
> increasing the size of the header, by reducing the maximum buffer size and
> changing the index accordingly.  The new maximums are still much larger than
> actually needed for current uses.
> 
> (2) Removes PtrQueue::_capacity_in_bytes and obtain queue capacity from the
> associated buffer.  The capacity accessor was renamed to current_capacity to
> make it clear that the result may vary, at least depending on whether the
> queue currently has a buffer or not.
> 
> (3) Adds empty/size operations to PtrQueue/BufferNode.
> 
> (4) Updates users to take advantage of the above changes.
> 
> Each of those steps is a separate commit, in case that aids reviewing.
> 
> Testing:
> mach5 tier1-5

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Merge branch 'master' into ptrqueue-size
 - use queue/node size/empty/capacity
 - add empty/size to PtrQueue/BufferNode
 - remove PtrQueue capacity_in_bytes
 - add capacity to BufferNode

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/15291/files
  - new: https://git.openjdk.org/jdk/pull/15291/files/eaf19129..399f19a5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15291&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15291&range=00-01

  Stats: 2484 lines in 88 files changed: 2270 ins; 49 del; 165 mod
  Patch: https://git.openjdk.org/jdk/pull/15291.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15291/head:pull/15291

PR: https://git.openjdk.org/jdk/pull/15291


More information about the hotspot-gc-dev mailing list