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

8276887: G1: Move precleaning to Concurrent Mark From Roots subphase #6327

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -919,13 +919,14 @@ class G1CMConcurrentMarkingTask : public WorkerTask {
} while (!_cm->has_aborted() && task->has_aborted());
}

void preclean() {
void preclean(uint worker_id) {
BarrierEnqueueDiscoveredFieldClosure enqueue;
G1PrecleanYieldClosure yield_cl(_cm);
_cm_rp->preclean_discovered_references(_cm_rp->is_alive_non_header(),
&enqueue,
&yield_cl,
_cm->_gc_timer_cm);
_cm->_gc_timer_cm,
worker_id);
}
public:
void work(uint worker_id) {
@@ -945,7 +946,7 @@ class G1CMConcurrentMarkingTask : public WorkerTask {

// Marking is complete; preclean non-strong references
if (G1UseReferencePrecleaning) {
preclean();
preclean(worker_id);
}
}
guarantee(!task->has_aborted() || _cm->has_aborted(), "invariant");
@@ -1067,11 +1067,10 @@ bool ReferenceProcessor::has_discovered_references() {
void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_alive,
EnqueueDiscoveredFieldClosure* enqueue,
YieldClosure* yield,
GCTimer* gc_timer) {
GCTimer* gc_timer,
uint worker_id) {
Ticks preclean_start = Ticks::now();

uint worker_id = WorkerThread::current()->id();

size_t soft_count = _discoveredSoftRefs[worker_id].length();
size_t weak_count = _discoveredWeakRefs[worker_id].length();
size_t final_count = _discoveredFinalRefs[worker_id].length();
@@ -318,7 +318,8 @@ class ReferenceProcessor : public ReferenceDiscoverer {
void preclean_discovered_references(BoolObjectClosure* is_alive,
EnqueueDiscoveredFieldClosure* enqueue,
YieldClosure* yield,
GCTimer* gc_timer);
GCTimer* gc_timer,
uint worker_id);

private:
// Returns the name of the discovered reference list