From 8817ba450c0eac6f7c1ff19b16c11a26ff2ed109 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Thu, 11 Apr 2024 08:52:01 +0000 Subject: [PATCH] 8330000: ZGC: ZObjArrayAllocator may unnecessarily clear TypeArrays twice Reviewed-by: stefank, eosterlund --- src/hotspot/share/gc/z/zObjArrayAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp index b5aaed3a27411..45f65f0e7e5d0 100644 --- a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp +++ b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp @@ -126,7 +126,7 @@ oop ZObjArrayAllocator::initialize(HeapWord* mem) const { yield_for_safepoint(); // Deal with safepoints - if (!seen_gc_safepoint && gc_safepoint_happened()) { + if (is_reference_type(element_type) && !seen_gc_safepoint && gc_safepoint_happened()) { // The first time we observe a GC safepoint in the yield point, // we have to restart processing with 11 remembered bits. seen_gc_safepoint = true;