7777#include " utilities/growableArray.hpp"
7878#include " utilities/powerOfTwo.hpp"
7979
80- G1CMIsAliveClosure::G1CMIsAliveClosure (G1CollectedHeap* g1h) :
81- _g1h(g1h), _cm(g1h->concurrent_mark ()) { }
82-
83- void G1CMIsAliveClosure::set_concurrent_mark (G1ConcurrentMark* cm) {
84- assert (_cm == nullptr , " already set" );
85- _cm = cm;
80+ G1CMIsAliveClosure::G1CMIsAliveClosure (G1ConcurrentMark* cm) : _cm(cm) {
81+ assert (cm != nullptr , " must be" );
8682}
8783
8884bool G1CMBitMapClosure::do_addr (HeapWord* const addr) {
@@ -857,8 +853,6 @@ class NoteStartOfMarkHRClosure : public HeapRegionClosure {
857853 bool do_heap_region (HeapRegion* r) override {
858854 if (r->is_old_or_humongous () && !r->is_collection_set_candidate ()) {
859855 _cm->update_top_at_mark_start (r);
860- } else {
861- _cm->reset_top_at_mark_start (r);
862856 }
863857 return false ;
864858 }
@@ -877,18 +871,8 @@ G1PreConcurrentStartTask::G1PreConcurrentStartTask(GCCause::Cause cause, G1Concu
877871 G1BatchedTask(" Pre Concurrent Start" , G1CollectedHeap::heap()->phase_times()) {
878872 add_serial_task (new ResetMarkingStateTask (cm));
879873 add_parallel_task (new NoteStartOfMarkTask ());
880-
881- // cm->invalidate_top_at_mark_starts();
882874};
883875
884- #ifdef ASSERT
885- void G1ConcurrentMark::invalidate_top_at_mark_starts () {
886- for (uint i = 0 ; i < G1CollectedHeap::heap ()->max_reserved_regions (); i++) {
887- _top_at_mark_starts[i] = nullptr ;
888- }
889- }
890- #endif
891-
892876void G1ConcurrentMark::pre_concurrent_start (GCCause::Cause cause) {
893877 assert_at_safepoint_on_vm_thread ();
894878
@@ -1357,7 +1341,7 @@ void G1ConcurrentMark::remark() {
13571341
13581342 // Unload Klasses, String, Code Cache, etc.
13591343 if (ClassUnloadingWithConcurrentMark) {
1360- G1CMIsAliveClosure is_alive (_g1h );
1344+ G1CMIsAliveClosure is_alive (this );
13611345 _g1h->unload_classes_and_code (" Class Unloading" , &is_alive, _gc_timer_cm);
13621346 }
13631347
@@ -1704,7 +1688,7 @@ class G1CMRefProcProxyTask : public RefProcProxyTask {
17041688
17051689 void work (uint worker_id) override {
17061690 assert (worker_id < _max_workers, " sanity" );
1707- G1CMIsAliveClosure is_alive (&_g1h );
1691+ G1CMIsAliveClosure is_alive (&_cm );
17081692 uint index = (_tm == RefProcThreadModel::Single) ? 0 : worker_id;
17091693 G1CMKeepAliveAndDrainClosure keep_alive (&_cm, _cm.task (index), _tm == RefProcThreadModel::Single);
17101694 BarrierEnqueueDiscoveredFieldClosure enqueue;
@@ -1783,7 +1767,7 @@ void G1ConcurrentMark::weak_refs_work() {
17831767
17841768 {
17851769 GCTraceTime (Debug, gc, phases) debug (" Weak Processing" , _gc_timer_cm);
1786- G1CMIsAliveClosure is_alive (_g1h );
1770+ G1CMIsAliveClosure is_alive (this );
17871771 WeakProcessor::weak_oops_do (_g1h->workers (), &is_alive, &do_nothing_cl, 1 );
17881772 }
17891773}
0 commit comments