From a9d8dbcae57f8226373bd16cfd3063ffa91d76c3 Mon Sep 17 00:00:00 2001 From: "lusou.zhangquan" Date: Tue, 9 Jun 2020 18:42:00 -0400 Subject: [PATCH] [Backport] 8246718: ParallelGC should not check for forward objects for copy task queue Summary: Prefetch task's oop markword and unconditionally push task. Testing: jtreg Reviewers: maoliang.ml, yude.lyd Issue: https://github.com/dragonwell-project/dragonwell11/issues/803 --- .../share/gc/parallel/psPromotionManager.hpp | 1 - .../gc/parallel/psPromotionManager.inline.hpp | 23 ++++--------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.hpp index 9e34a4277f4..a4bee5db694 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp @@ -93,7 +93,6 @@ class PSPromotionManager { static MutableSpace* young_space() { return _young_space; } inline static PSPromotionManager* manager_array(uint index); - template inline void claim_or_forward_internal_depth(T* p); // On the task queues we push reference locations as well as // partially-scanned arrays (in the latter case, we push an oop to diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp index 382c8cd73da..1d204cd883c 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp @@ -35,6 +35,7 @@ #include "logging/log.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" +#include "runtime/prefetch.inline.hpp" inline PSPromotionManager* PSPromotionManager::manager_array(uint index) { assert(_manager_array != NULL, "access of NULL manager_array"); @@ -47,29 +48,13 @@ inline void PSPromotionManager::push_depth(T* p) { claimed_stack_depth()->push(p); } -template -inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { - if (p != NULL) { // XXX: error if p != NULL here - oop o = RawAccess::oop_load(p); - if (o->is_forwarded()) { - o = o->forwardee(); - // Card mark - if (PSScavenge::is_obj_in_young(o)) { - PSScavenge::card_table()->inline_write_ref_field_gc(p, o); - } - RawAccess::oop_store(p, o); - } else { - push_depth(p); - } - } -} - template inline void PSPromotionManager::claim_or_forward_depth(T* p) { assert(should_scavenge(p, true), "revisiting object?"); assert(ParallelScavengeHeap::heap()->is_in(p), "pointer outside heap"); - - claim_or_forward_internal_depth(p); + oop obj = RawAccess::oop_load(p); + Prefetch::write(obj->mark_addr_raw(), 0); + push_depth(p); } inline void PSPromotionManager::promotion_trace_event(oop new_obj, Klass* klass,