Skip to content
Permalink
Browse files
8246718: ParallelGC should not check for forward objects for copy tas…
…k queue

Prefetch task's oop markword and unconditionally push task.

Reviewed-by: tschatzl, eosterlund
  • Loading branch information
Kim Barrett committed Jun 9, 2020
1 parent 27e1686 commit 0bf3ba402bf67ee31a09bd3b5f39121e26e7630c
Showing 2 changed files with 4 additions and 20 deletions.
@@ -99,7 +99,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);

template <class T> void process_array_chunk_work(oop obj,
int start, int end);
@@ -36,6 +36,7 @@
#include "memory/iterator.inline.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(ScannerTask task) {
claimed_stack_depth()->push(task);
}

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(ScannerTask(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(ScannerTask(p));
}

inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj,

0 comments on commit 0bf3ba4

Please sign in to comment.