RFR: 8358586: ZGC: Combine ZAllocator and ZObjectAllocator [v10]

Stefan Karlsson stefank at openjdk.org
Thu Jun 26 07:39:33 UTC 2025


On Thu, 26 Jun 2025 07:26:09 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> src/hotspot/share/gc/z/zObjectAllocator.cpp line 207:
>> 
>>> 205:   : _allocators() {
>>> 206: 
>>> 207:   for (ZPageAge age : ZPageAgeRange()) {
>> 
>> Could this be using `ZPageAgeRangeAll`?
>
> I remember we discussed a `ZPageAgeRangeAll`, but it's not in the code right now. I agree that it becomes clearer that we're iterating over *all* ages with a `ZPageRangeAll` instead of `ZPageAgeRange()`.
> 
> constexpr ZPageAgeRange ZPageAgeRangeAll = ZPageAgeRange();
> 
> 
> I don't have anything against adding `ZPageAgeRangeAll` and replacing all the other usages of `ZPageRange()` in this patch, but we could also do that in a follow up.
> 
> The other usages:
> 
> src/hotspot/share/gc/z/zRelocationSetSelector.cpp
> 243:  for (ZPageAge age : ZPageAgeRange()) {
> 
> src/hotspot/share/gc/z/zStat.cpp
> 1503:  for (ZPageAge age : ZPageAgeRange()) {
> 1564:  for (ZPageAge age : ZPageAgeRange()) {
> 1793:  for (ZPageAge age : ZPageAgeRange()) {
> 
> src/hotspot/share/gc/z/zRelocationSetSelector.inline.hpp
> 192:  for (ZPageAge age : ZPageAgeRange()) {
> 200:  for (ZPageAge age : ZPageAgeRange()) {
> 208:  for (ZPageAge age : ZPageAgeRange()) {
> 
> src/hotspot/share/gc/z/zGeneration.cpp
> 703:  for (ZPageAge age : ZPageAgeRange()) {

OK. I thought that you had already added that. Let's keep the current version of the code in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25693#discussion_r2168400300


More information about the hotspot-gc-dev mailing list