8210100: ParallelGC should use parallel WeakProcessor
Reviewed-by: kbarrett, tschatzl, sjohanss
This commit is contained in:
parent
679faa691a
commit
0da889edf3
@ -32,6 +32,26 @@
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
class PSAdjustWeakRootsClosure final: public OopClosure {
|
||||
public:
|
||||
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
||||
|
||||
virtual void do_oop(oop* p) {
|
||||
if (PSScavenge::should_scavenge(p)) {
|
||||
oop o = RawAccess<IS_NOT_NULL>::oop_load(p);
|
||||
assert(o->is_forwarded(), "Objects are already forwarded before weak processing");
|
||||
oop new_obj = o->forwardee();
|
||||
if (log_develop_is_enabled(Trace, gc, scavenge)) {
|
||||
ResourceMark rm; // required by internal_name()
|
||||
log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
|
||||
"forwarding",
|
||||
new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
|
||||
}
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <bool promote_immediately>
|
||||
class PSRootsClosure: public OopClosure {
|
||||
private:
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include "gc/shared/scavengableNMethods.hpp"
|
||||
#include "gc/shared/spaceDecorator.inline.hpp"
|
||||
#include "gc/shared/taskTerminator.hpp"
|
||||
#include "gc/shared/weakProcessor.hpp"
|
||||
#include "gc/shared/weakProcessor.inline.hpp"
|
||||
#include "gc/shared/workerPolicy.hpp"
|
||||
#include "gc/shared/workgroup.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
@ -520,11 +520,10 @@ bool PSScavenge::invoke_no_policy() {
|
||||
|
||||
assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
|
||||
|
||||
PSScavengeRootsClosure root_closure(promotion_manager);
|
||||
|
||||
{
|
||||
GCTraceTime(Debug, gc, phases) tm("Weak Processing", &_gc_timer);
|
||||
WeakProcessor::weak_oops_do(&_is_alive_closure, &root_closure);
|
||||
PSAdjustWeakRootsClosure root_closure;
|
||||
WeakProcessor::weak_oops_do(&ParallelScavengeHeap::heap()->workers(), &_is_alive_closure, &root_closure, 1);
|
||||
}
|
||||
|
||||
// Verify that usage of root_closure didn't copy any objects.
|
||||
|
Loading…
x
Reference in New Issue
Block a user