< prev index next > src/hotspot/share/gc/parallel/psClosure.inline.hpp
8211447_01: revision due to comments from StefanJ and Thomas
#include "memory/iterator.hpp"
#include "oops/access.inline.hpp"
#include "oops/oop.inline.hpp"
#include "utilities/globalDefinitions.hpp"
-template<bool promote_immediately>
+template <bool promote_immediately>
class PSRootsClosure: public OopClosure {
- private:
+private:
PSPromotionManager* _promotion_manager;
- protected:
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<T, promote_immediately>(p);
}
typedef PSRootsClosure</*promote_immediately=*/false> PSScavengeRootsClosure;
typedef PSRootsClosure</*promote_immediately=*/true> PSPromoteRootsClosure;
// Scavenges a single oop in a ClassLoaderData.
class PSScavengeFromCLDClosure: public OopClosure {
- private:
+private:
PSPromotionManager* _pm;
// Used to redirty a scanned cld if it has oops
// pointing to the young generation after being scanned.
ClassLoaderData* _scanned_cld;
- public:
+public:
PSScavengeFromCLDClosure(PSPromotionManager* pm) : _pm(pm), _scanned_cld(NULL) { }
void do_oop(narrowOop* p) { ShouldNotReachHere(); }
void do_oop(oop* p) {
ParallelScavengeHeap* psh = ParallelScavengeHeap::heap();
assert(!psh->is_in_reserved(p), "GC barrier needed");
void set_scanned_cld(ClassLoaderData* cld) {
assert(_scanned_cld == NULL || cld == NULL, "Should always only handling one cld at a time");
_scanned_cld = cld;
}
- private:
+private:
void do_cld_barrier() {
assert(_scanned_cld != NULL, "Should not be called without having a scanned cld");
_scanned_cld->record_modified_oops();
}
};
// Scavenges the oop in a ClassLoaderData.
class PSScavengeCLDClosure: public CLDClosure {
- private:
+private:
PSScavengeFromCLDClosure _oop_closure;
- protected:
- public:
+public:
PSScavengeCLDClosure(PSPromotionManager* pm) : _oop_closure(pm) { }
void do_cld(ClassLoaderData* cld) {
// If the cld has not been dirtied we know that there's
// no references into the young gen and we can skip it.
< prev index next >