8035401: Fix visibility of G1ParScanThreadState members

After JDK-8035400 there were several opportunities to fix the visibility of several members of the G1ParScanThreadState class.

Reviewed-by: brutisso, mgerdin
This commit is contained in:
Thomas Schatzl 2014-06-26 15:48:05 +02:00
parent 0bd028231f
commit b4e0c547b8
4 changed files with 131 additions and 117 deletions

View file

@ -43,6 +43,30 @@ template <class T> void G1ParScanThreadState::update_rs(HeapRegion* from, T* p,
}
}
template <class T> void G1ParScanThreadState::do_oop_evac(T* p, HeapRegion* from) {
assert(!oopDesc::is_null(oopDesc::load_decode_heap_oop(p)),
"Reference should not be NULL here as such are never pushed to the task queue.");
oop obj = oopDesc::load_decode_heap_oop_not_null(p);
// Although we never intentionally push references outside of the collection
// set, due to (benign) races in the claim mechanism during RSet scanning more
// than one thread might claim the same card. So the same card may be
// processed multiple times. So redo this check.
if (_g1h->in_cset_fast_test(obj)) {
oop forwardee;
if (obj->is_forwarded()) {
forwardee = obj->forwardee();
} else {
forwardee = copy_to_survivor_space(obj);
}
assert(forwardee != NULL, "forwardee should not be NULL");
oopDesc::encode_store_heap_oop(p, forwardee);
}
assert(obj != NULL, "Must be");
update_rs(from, p, queue_num());
}
inline void G1ParScanThreadState::do_oop_partial_array(oop* p) {
assert(has_partial_array_mask(p), "invariant");
oop from_obj = clear_partial_array_mask(p);
@ -104,7 +128,7 @@ template <class T> inline void G1ParScanThreadState::deal_with_reference(T* ref_
}
}
inline void G1ParScanThreadState::deal_with_reference(StarTask ref) {
inline void G1ParScanThreadState::dispatch_reference(StarTask ref) {
assert(verify_task(ref), "sanity");
if (ref.is_narrow()) {
deal_with_reference((narrowOop*)ref);
@ -113,5 +137,18 @@ inline void G1ParScanThreadState::deal_with_reference(StarTask ref) {
}
}
void G1ParScanThreadState::steal_and_trim_queue(RefToScanQueueSet *task_queues) {
StarTask stolen_task;
while (task_queues->steal(queue_num(), hash_seed(), stolen_task)) {
assert(verify_task(stolen_task), "sanity");
dispatch_reference(stolen_task);
// We've just processed a reference and we might have made
// available new entries on the queues. So we have to make sure
// we drain the queues as necessary.
trim_queue();
}
}
#endif /* SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_INLINE_HPP */