8225706: JFR RootResolver resets CLD claims with no restore
Reviewed-by: zgu, egahlin
--- a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp Tue Jul 02 11:33:05 2019 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp Tue Jul 02 14:31:43 2019 +0200
@@ -30,7 +30,6 @@
#include "gc/shared/strongRootsScope.hpp"
#include "jfr/leakprofiler/chains/edgeQueue.hpp"
#include "jfr/leakprofiler/chains/rootSetClosure.hpp"
-#include "jfr/leakprofiler/utilities/saveRestore.hpp"
#include "jfr/leakprofiler/utilities/unifiedOop.hpp"
#include "memory/universe.hpp"
#include "oops/access.inline.hpp"
@@ -92,10 +91,9 @@
};
void RootSetClosure::process_roots(OopClosure* closure) {
- SaveRestoreCLDClaimBits save_restore_cld_claim_bits;
RootSetClosureMarkScope mark_scope;
- CLDToOopClosure cldt_closure(closure, ClassLoaderData::_claim_strong);
+ CLDToOopClosure cldt_closure(closure, ClassLoaderData::_claim_none);
ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
CodeBlobToOopClosure blobs(closure, false);
Threads::oops_do(closure, &blobs);
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp Tue Jul 02 11:33:05 2019 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp Tue Jul 02 14:31:43 2019 +0200
@@ -132,7 +132,7 @@
bool ReferenceToRootClosure::do_cldg_roots() {
assert(!complete(), "invariant");
ReferenceLocateClosure rlc(_callback, OldObjectRoot::_class_loader_data, OldObjectRoot::_type_undetermined, NULL);
- CLDToOopClosure cldt_closure(&rlc, ClassLoaderData::_claim_strong);
+ CLDToOopClosure cldt_closure(&rlc, ClassLoaderData::_claim_none);
ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
return rlc.complete();
}
@@ -435,9 +435,6 @@
};
void RootResolver::resolve(RootCallback& callback) {
-
- // Need to clear cld claim bit before starting
- ClassLoaderDataGraph::clear_claimed_marks();
RootResolverMarkScope mark_scope;
// thread local roots