8283513: Parallel: Skip the card marking in PSRootsClosure
Reviewed-by: tschatzl, iwalulya
This commit is contained in:
parent
78ef2fdef6
commit
dc45b0ac58
src/hotspot/share/gc/parallel
@ -60,9 +60,12 @@ private:
|
||||
PSPromotionManager* _promotion_manager;
|
||||
|
||||
template <class T> void do_oop_work(T *p) {
|
||||
if (PSScavenge::should_scavenge(p)) {
|
||||
// We never card mark roots, maybe call a func without test?
|
||||
_promotion_manager->copy_and_push_safe_barrier<promote_immediately>(p);
|
||||
assert(!ParallelScavengeHeap::heap()->is_in_reserved(p), "roots should be outside of heap");
|
||||
oop o = RawAccess<>::oop_load(p);
|
||||
if (PSScavenge::is_obj_in_young(o)) {
|
||||
assert(!PSScavenge::is_obj_in_to_space(o), "Revisiting roots?");
|
||||
oop new_obj = _promotion_manager->copy_to_survivor_space<promote_immediately>(o);
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
|
||||
}
|
||||
}
|
||||
public:
|
||||
|
@ -300,24 +300,18 @@ inline oop PSPromotionManager::copy_unmarked_to_survivor_space(oop o,
|
||||
}
|
||||
|
||||
// Attempt to "claim" oop at p via CAS, push the new obj if successful
|
||||
// This version tests the oop* to make sure it is within the heap before
|
||||
// attempting marking.
|
||||
template <bool promote_immediately, class T>
|
||||
inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) {
|
||||
assert(ParallelScavengeHeap::heap()->is_in_reserved(p), "precondition");
|
||||
assert(should_scavenge(p, true), "revisiting object?");
|
||||
|
||||
oop o = RawAccess<IS_NOT_NULL>::oop_load(p);
|
||||
oop new_obj = copy_to_survivor_space<promote_immediately>(o);
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
|
||||
|
||||
// We cannot mark without test, as some code passes us pointers
|
||||
// that are outside the heap. These pointers are either from roots
|
||||
// or from metadata.
|
||||
if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) &&
|
||||
ParallelScavengeHeap::heap()->is_in_reserved(p)) {
|
||||
if (PSScavenge::is_obj_in_young(new_obj)) {
|
||||
PSScavenge::card_table()->inline_write_ref_field_gc(p, new_obj);
|
||||
}
|
||||
if (!PSScavenge::is_obj_in_young((HeapWord*)p) &&
|
||||
PSScavenge::is_obj_in_young(new_obj)) {
|
||||
PSScavenge::card_table()->inline_write_ref_field_gc(p, new_obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,10 @@ class PSScavenge: AllStatic {
|
||||
inline static bool is_obj_in_young(HeapWord* o) {
|
||||
return o >= _young_generation_boundary;
|
||||
}
|
||||
|
||||
static bool is_obj_in_to_space(oop o) {
|
||||
return ParallelScavengeHeap::young_gen()->to_space()->contains(o);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_PARALLEL_PSSCAVENGE_HPP
|
||||
|
Loading…
x
Reference in New Issue
Block a user