From b92a44364d3a2267f5bc9aef3077805bebdf9fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Sikstr=C3=B6m?= Date: Fri, 4 Apr 2025 11:53:11 +0000 Subject: [PATCH] 8353471: ZGC: Redundant generation id in ZGeneration Reviewed-by: stefank, eosterlund --- src/hotspot/share/gc/z/zGeneration.cpp | 10 +++++----- src/hotspot/share/gc/z/zGeneration.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/gc/z/zGeneration.cpp b/src/hotspot/share/gc/z/zGeneration.cpp index 0dc8e93b8e7..f8475256733 100644 --- a/src/hotspot/share/gc/z/zGeneration.cpp +++ b/src/hotspot/share/gc/z/zGeneration.cpp @@ -182,9 +182,9 @@ static double fragmentation_limit(ZGenerationId generation) { } } -void ZGeneration::select_relocation_set(ZGenerationId generation, bool promote_all) { +void ZGeneration::select_relocation_set(bool promote_all) { // Register relocatable pages with selector - ZRelocationSetSelector selector(fragmentation_limit(generation)); + ZRelocationSetSelector selector(fragmentation_limit(_id)); { ZGenerationPagesIterator pt_iter(_page_table, _id, _page_allocator); for (ZPage* page; pt_iter.next(&page);) { @@ -238,7 +238,7 @@ void ZGeneration::select_relocation_set(ZGenerationId generation, bool promote_a // Selecting tenuring threshold must be done after select // which produces the liveness data, but before install, // which consumes the tenuring threshold. - if (generation == ZGenerationId::young) { + if (is_young()) { ZGeneration::young()->select_tenuring_threshold(selector.stats(), promote_all); } @@ -811,7 +811,7 @@ uint ZGenerationYoung::compute_tenuring_threshold(ZRelocationSetSelectorStats st void ZGenerationYoung::concurrent_select_relocation_set() { ZStatTimerYoung timer(ZPhaseConcurrentSelectRelocationSetYoung); const bool promote_all = type() == ZYoungType::major_full_preclean; - select_relocation_set(_id, promote_all); + select_relocation_set(promote_all); } class VM_ZRelocateStartYoung : public VM_ZYoungOperation { @@ -1153,7 +1153,7 @@ void ZGenerationOld::pause_verify() { void ZGenerationOld::concurrent_select_relocation_set() { ZStatTimerOld timer(ZPhaseConcurrentSelectRelocationSetOld); - select_relocation_set(_id, false /* promote_all */); + select_relocation_set(false /* promote_all */); } class VM_ZRelocateStartOld : public VM_ZOperation { diff --git a/src/hotspot/share/gc/z/zGeneration.hpp b/src/hotspot/share/gc/z/zGeneration.hpp index 2670ab51699..922efe5ef9e 100644 --- a/src/hotspot/share/gc/z/zGeneration.hpp +++ b/src/hotspot/share/gc/z/zGeneration.hpp @@ -91,7 +91,7 @@ protected: void mark_free(); - void select_relocation_set(ZGenerationId generation, bool promote_all); + void select_relocation_set(bool promote_all); void reset_relocation_set(); ZGeneration(ZGenerationId id, ZPageTable* page_table, ZPageAllocator* page_allocator);