8252289: Remove usage of OopsInGenClosure from full_process_roots

Reviewed-by: sjohanss, kbarrett
This commit is contained in:
Stefan Karlsson 2020-08-28 17:20:13 +02:00
parent f0acabc64b
commit 07a879a9f7
5 changed files with 4 additions and 28 deletions

@ -178,12 +178,6 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
GenCollectedHeap* gch = GenCollectedHeap::heap();
// Because follow_root_closure is created statically, cannot
// use OopsInGenClosure constructor which takes a generation,
// as the Universe has not been created when the static constructors
// are run.
follow_root_closure.set_orig_generation(gch->old_gen());
// Need new claim bits before marking starts.
ClassLoaderDataGraph::clear_claimed_marks();
@ -277,12 +271,6 @@ void GenMarkSweep::mark_sweep_phase3() {
// Need new claim bits for the pointer adjustment tracing.
ClassLoaderDataGraph::clear_claimed_marks();
// Because the closure below is created statically, we cannot
// use OopsInGenClosure constructor which takes a generation,
// as the Universe has not been created when the static constructors
// are run.
adjust_pointer_closure.set_orig_generation(gch->old_gen());
{
StrongRootsScope srs(1);

@ -56,7 +56,7 @@ class MarkSweep : AllStatic {
//
// Inline closure decls
//
class FollowRootClosure: public BasicOopsInGenClosure {
class FollowRootClosure: public BasicOopIterateClosure {
public:
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
@ -185,7 +185,7 @@ public:
}
};
class AdjustPointerClosure: public BasicOopsInGenClosure {
class AdjustPointerClosure: public BasicOopIterateClosure {
public:
template <typename T> void do_oop_work(T* p);
virtual void do_oop(oop* p);

@ -876,7 +876,7 @@ void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
bool is_adjust_phase,
ScanningOption so,
bool only_strong_roots,
OopsInGenClosure* root_closure,
OopClosure* root_closure,
CLDClosure* cld_closure) {
MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;

@ -380,7 +380,7 @@ public:
bool is_adjust_phase,
ScanningOption so,
bool only_strong_roots,
OopsInGenClosure* root_closure,
OopClosure* root_closure,
CLDClosure* cld_closure);
// Apply "root_closure" to all the weak roots of the system.

@ -58,28 +58,16 @@ class OopsInGenClosure : public OopIterateClosure {
template <class T> void do_barrier(T* p);
public:
OopsInGenClosure() : OopIterateClosure(NULL),
_orig_gen(NULL), _gen(NULL), _gen_boundary(NULL), _rs(NULL) {};
OopsInGenClosure(Generation* gen);
void set_generation(Generation* gen);
void reset_generation() { _gen = _orig_gen; }
// Problem with static closures: must have _gen_boundary set at some point,
// but cannot do this until after the heap is initialized.
void set_orig_generation(Generation* gen) {
_orig_gen = gen;
set_generation(gen);
}
HeapWord* gen_boundary() { return _gen_boundary; }
};
class BasicOopsInGenClosure: public OopsInGenClosure {
public:
BasicOopsInGenClosure() : OopsInGenClosure() {}
BasicOopsInGenClosure(Generation* gen);
virtual bool do_metadata() { return false; }