Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269803: G1: remove unnecessary NoRefDiscovery #4664

wants to merge 2 commits into from
Changes from 1 commit
File filter
Filter by extension
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -2992,12 +2992,6 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
// reference processing currently works in G1.
_ref_processor_stw->start_discovery(false /* always_clear */);

// We want to temporarily turn off discovery by the
// CM ref processor, if necessary, and turn it back on
// on again later if we do. Using a scoped
// NoRefDiscovery object will do this.
NoRefDiscovery no_cm_discovery(_ref_processor_cm);


// Forget the current allocation region (we might even choose it to be part
@@ -456,27 +456,6 @@ class SpanSubjectToDiscoveryClosure : public BoolObjectClosure {

// A utility class to disable reference discovery in
// the scope which contains it, for given ReferenceProcessor.
class NoRefDiscovery: StackObj {
ReferenceProcessor* _rp;
bool _was_discovering_refs;
NoRefDiscovery(ReferenceProcessor* rp) : _rp(rp) {
_was_discovering_refs = _rp->discovery_enabled();
if (_was_discovering_refs) {

~NoRefDiscovery() {
if (_was_discovering_refs) {
_rp->enable_discovery(false /*check_no_refs*/);

// A utility class to temporarily mutate the subject discovery closure of the
// given ReferenceProcessor in the scope that contains it.
class ReferenceProcessorSubjectToDiscoveryMutator : StackObj {