From c207cc7e705d3f449f2387324d86cfb31ce40c44 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 20 Jan 2025 09:51:45 +0000 Subject: [PATCH] 8347923: Parallel: Simplify compute_survivor_space_size_and_threshold Reviewed-by: tschatzl --- src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp index 98ffc6a103f..7e84e4d0ad3 100644 --- a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp +++ b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp @@ -947,12 +947,10 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold( // Finally, increment or decrement the tenuring threshold, as decided above. // We test for decrementing first, as we might have hit the target size // limit. - if (decr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) { - if (tenuring_threshold > 1) { + if (!(AlwaysTenure || NeverTenure)) { + if (decr_tenuring_threshold && tenuring_threshold > 1) { tenuring_threshold--; - } - } else if (incr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) { - if (tenuring_threshold < MaxTenuringThreshold) { + } else if (incr_tenuring_threshold && tenuring_threshold < MaxTenuringThreshold) { tenuring_threshold++; } }