Skip to content

Commit

Permalink
[Backport] 8246718: ParallelGC should not check for forward objects f…
Browse files Browse the repository at this point in the history
…or copy task queue

Summary: Prefetch task's oop markword and unconditionally push task.

Testing: jtreg

Reviewers: maoliang.ml, yude.lyd

Issue: #803
  • Loading branch information
lusou-zhangquan committed Jun 21, 2024
1 parent dc1b6cd commit a9d8dbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/hotspot/share/gc/parallel/psPromotionManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class PSPromotionManager {
static MutableSpace* young_space() { return _young_space; }

inline static PSPromotionManager* manager_array(uint index);
template <class T> 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
Expand Down
23 changes: 4 additions & 19 deletions src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -47,29 +48,13 @@ inline void PSPromotionManager::push_depth(T* p) {
claimed_stack_depth()->push(p);
}

template <class T>
inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
if (p != NULL) { // XXX: error if p != NULL here
oop o = RawAccess<IS_NOT_NULL>::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<IS_NOT_NULL>::oop_store(p, o);
} else {
push_depth(p);
}
}
}

template <class T>
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<IS_NOT_NULL>::oop_load(p);
Prefetch::write(obj->mark_addr_raw(), 0);
push_depth(p);
}

inline void PSPromotionManager::promotion_trace_event(oop new_obj, Klass* klass,
Expand Down

0 comments on commit a9d8dbc

Please sign in to comment.