From 02cc67fd514c34cffc61bc89da39a9ff8a05ae69 Mon Sep 17 00:00:00 2001
Date: Wed, 8 Dec 2021 09:59:36 +0800
Subject: [PATCH] Add prefetch before copy in
 PSPromotionManager::copy_to_survivor_space

---
 src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
index 5eb6a20b0..a0149e447 100644
--- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
@@ -248,6 +248,8 @@ inline oop PSPromotionManager::copy_unmarked_to_survivor_space(oop o,
 
   assert(new_obj != NULL, "allocation should have succeeded");
 
+  Prefetch::write(new_obj, PrefetchCopyIntervalInBytes);
+
   // Copy obj
   Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(o), cast_from_oop<HeapWord*>(new_obj), new_obj_size);
 
-- 
2.19.0

