--- old/src/share/vm/gc/g1/g1CardLiveData.cpp 2017-03-21 16:20:06.313641153 -0400 +++ new/src/share/vm/gc/g1/g1CardLiveData.cpp 2017-03-21 16:20:05.113571823 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -265,7 +265,7 @@ } }; -class G1CreateCardLiveDataTask: public AbstractGangTask { +class G1CreateCardLiveDataTask: public G1ParallelizeByRegionsTask { // Aggregate the counting data that was constructed concurrently // with marking. class G1CreateLiveDataClosure : public HeapRegionClosure { @@ -296,15 +296,13 @@ G1ConcurrentMark* _cm; G1CardLiveData* _live_data; - HeapRegionClaimer _hr_claimer; public: G1CreateCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* live_data, uint n_workers) : - AbstractGangTask("G1 Create Live Data"), - _live_data(live_data), - _hr_claimer(n_workers) { + G1ParallelizeByRegionsTask("G1 Create Live Data", n_workers), + _live_data(live_data) { } void work(uint worker_id) { @@ -313,7 +311,7 @@ G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1ConcurrentMark* cm = g1h->concurrent_mark(); G1CreateLiveDataClosure cl(g1h, cm, cm->nextMarkBitMap(), _live_data); - g1h->heap_region_par_iterate(&cl, worker_id, &_hr_claimer); + all_heap_regions_work(&cl, worker_id); } }; @@ -328,7 +326,7 @@ workers->run_task(&cl); } -class G1FinalizeCardLiveDataTask: public AbstractGangTask { +class G1FinalizeCardLiveDataTask: public G1ParallelizeByRegionsTask { // Finalizes the liveness counting data. // Sets the bits corresponding to the interval [NTAMS, top] // (which contains the implicitly live objects) in the @@ -367,20 +365,16 @@ G1CardLiveData* _live_data; - HeapRegionClaimer _hr_claimer; - public: G1FinalizeCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* live_data, uint n_workers) : - AbstractGangTask("G1 Finalize Card Live Data"), + G1ParallelizeByRegionsTask("G1 Finalize Card Live Data", n_workers), _bitmap(bitmap), - _live_data(live_data), - _hr_claimer(n_workers) { + _live_data(live_data) { } void work(uint worker_id) { G1FinalizeCardLiveDataClosure cl(G1CollectedHeap::heap(), _bitmap, _live_data); - - G1CollectedHeap::heap()->heap_region_par_iterate(&cl, worker_id, &_hr_claimer); + all_heap_regions_work(&cl, worker_id); } }; @@ -436,7 +430,7 @@ live_regions_bm().clear(); } -class G1VerifyCardLiveDataTask: public AbstractGangTask { +class G1VerifyCardLiveDataTask: public G1ParallelizeByRegionsTask { // Heap region closure used for verifying the live count data // that was created concurrently and finalized during // the remark pause. This closure is applied to the heap @@ -537,19 +531,16 @@ int _failures; - HeapRegionClaimer _hr_claimer; - public: G1VerifyCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* act_live_data, uint n_workers) - : AbstractGangTask("G1 Verify Card Live Data"), + : G1ParallelizeByRegionsTask("G1 Verify Card Live Data", n_workers), _g1h(G1CollectedHeap::heap()), _mark_bitmap(bitmap), _act_live_data(act_live_data), _exp_live_data(), - _failures(0), - _hr_claimer(n_workers) { + _failures(0) { assert(VerifyDuringGC, "don't call this otherwise"); _exp_live_data.initialize(_g1h->max_capacity(), _g1h->max_regions()); } @@ -559,7 +550,7 @@ _mark_bitmap, _act_live_data, &_exp_live_data); - _g1h->heap_region_par_iterate(&cl, worker_id, &_hr_claimer); + all_heap_regions_work(&cl, worker_id); Atomic::add(cl.failures(), &_failures); }