RFR: 8296776: Stop using mtNone as marker for CHeap allocations in GrowableArray [v4]

Stefan Karlsson stefank at openjdk.org
Tue Nov 15 09:03:32 UTC 2022


> Today we use mtNone to denote that a GrowableArray should *NOT* be backed by a CHeap allocated array.
> 
> I've gotten feedback that it would probably be good to limit the usage of mtNone, and at some point maybe completely remove it.
> 
> This patch takes a small step to remove mtNone from the GrowableArray. What's left is only asserts to forbid that value. Those asserts will be trivial to remove when/if mtNone is removed.
> 
> Just like in the proposed patch to make MEMFLAGS non-optional in CHeapBitMap (see JDK-[JDK-8296774](https://bugs.openjdk.org/browse/JDK-8296774)), I have thrown around the parameter order for GrowableArray. When looking at the changes to the usages of CHeap-backed GrowableArrays it becomes apparent that all of these usages where forced to provide a value for the initial capacity. When MEMFLAGS move to the front, we can now skip having to figure an initial capacity.

Stefan Karlsson 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 four additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into 8296776_growablearray_mtnone_cleanout_review
 - Review dholmes
 - Mark constructors explicit
 - 8296776: Stop using mtNone as marker for CHeap allocations in GrowableArray

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11086/files
  - new: https://git.openjdk.org/jdk/pull/11086/files/7b43d04a..dfa1171b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11086&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11086&range=02-03

  Stats: 3864 lines in 227 files changed: 2273 ins; 1062 del; 529 mod
  Patch: https://git.openjdk.org/jdk/pull/11086.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11086/head:pull/11086

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


More information about the hotspot-dev mailing list