src/share/vm/gc/g1/g1CardLiveData.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 263,273 **** _heap_card_bias = uintptr_t(base_address) >> CardTableModRefBS::card_shift; } }; ! class G1CreateCardLiveDataTask: public AbstractGangTask { // Aggregate the counting data that was constructed concurrently // with marking. class G1CreateLiveDataClosure : public HeapRegionClosure { G1CardLiveDataHelper _helper; --- 263,273 ---- _heap_card_bias = uintptr_t(base_address) >> CardTableModRefBS::card_shift; } }; ! class G1CreateCardLiveDataTask: public G1ParallelizeByRegionsTask { // Aggregate the counting data that was constructed concurrently // with marking. class G1CreateLiveDataClosure : public HeapRegionClosure { G1CardLiveDataHelper _helper;
*** 294,321 **** } }; 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) { } void work(uint worker_id) { SuspendibleThreadSetJoiner sts_join; 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); } }; void G1CardLiveData::create(WorkGang* workers, G1CMBitMap* mark_bitmap) { _gc_timestamp_at_create = G1CollectedHeap::heap()->get_gc_time_stamp(); --- 294,319 ---- } }; G1ConcurrentMark* _cm; G1CardLiveData* _live_data; public: G1CreateCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* live_data, uint n_workers) : ! G1ParallelizeByRegionsTask("G1 Create Live Data", n_workers), ! _live_data(live_data) { } void work(uint worker_id) { SuspendibleThreadSetJoiner sts_join; G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1ConcurrentMark* cm = g1h->concurrent_mark(); G1CreateLiveDataClosure cl(g1h, cm, cm->nextMarkBitMap(), _live_data); ! all_heap_regions_work(&cl, worker_id); } }; void G1CardLiveData::create(WorkGang* workers, G1CMBitMap* mark_bitmap) { _gc_timestamp_at_create = G1CollectedHeap::heap()->get_gc_time_stamp();
*** 326,336 **** this, n_workers); workers->run_task(&cl); } ! class G1FinalizeCardLiveDataTask: public AbstractGangTask { // Finalizes the liveness counting data. // Sets the bits corresponding to the interval [NTAMS, top] // (which contains the implicitly live objects) in the // card liveness bitmap. Also sets the bit for each region // containing live data, in the region liveness bitmap. --- 324,334 ---- this, n_workers); workers->run_task(&cl); } ! 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 // card liveness bitmap. Also sets the bit for each region // containing live data, in the region liveness bitmap.
*** 365,388 **** G1CMBitMap* _bitmap; G1CardLiveData* _live_data; - HeapRegionClaimer _hr_claimer; - public: G1FinalizeCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* live_data, uint n_workers) : ! AbstractGangTask("G1 Finalize Card Live Data"), _bitmap(bitmap), ! _live_data(live_data), ! _hr_claimer(n_workers) { } void work(uint worker_id) { G1FinalizeCardLiveDataClosure cl(G1CollectedHeap::heap(), _bitmap, _live_data); ! ! G1CollectedHeap::heap()->heap_region_par_iterate(&cl, worker_id, &_hr_claimer); } }; void G1CardLiveData::finalize(WorkGang* workers, G1CMBitMap* mark_bitmap) { // Finalize the live data. --- 363,382 ---- G1CMBitMap* _bitmap; G1CardLiveData* _live_data; public: G1FinalizeCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* live_data, uint n_workers) : ! G1ParallelizeByRegionsTask("G1 Finalize Card Live Data", n_workers), _bitmap(bitmap), ! _live_data(live_data) { } void work(uint worker_id) { G1FinalizeCardLiveDataClosure cl(G1CollectedHeap::heap(), _bitmap, _live_data); ! all_heap_regions_work(&cl, worker_id); } }; void G1CardLiveData::finalize(WorkGang* workers, G1CMBitMap* mark_bitmap) { // Finalize the live data.
*** 434,444 **** // The region live bitmap is always very small, even for huge heaps. Clear // directly. live_regions_bm().clear(); } ! class G1VerifyCardLiveDataTask: public AbstractGangTask { // 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 // regions during the STW cleanup pause. class G1VerifyCardLiveDataClosure: public HeapRegionClosure { --- 428,438 ---- // The region live bitmap is always very small, even for huge heaps. Clear // directly. live_regions_bm().clear(); } ! 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 // regions during the STW cleanup pause. class G1VerifyCardLiveDataClosure: public HeapRegionClosure {
*** 535,567 **** G1CardLiveData _exp_live_data; int _failures; - HeapRegionClaimer _hr_claimer; - public: G1VerifyCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* act_live_data, uint n_workers) ! : AbstractGangTask("G1 Verify Card Live Data"), _g1h(G1CollectedHeap::heap()), _mark_bitmap(bitmap), _act_live_data(act_live_data), _exp_live_data(), ! _failures(0), ! _hr_claimer(n_workers) { assert(VerifyDuringGC, "don't call this otherwise"); _exp_live_data.initialize(_g1h->max_capacity(), _g1h->max_regions()); } void work(uint worker_id) { G1VerifyCardLiveDataClosure cl(_g1h, _mark_bitmap, _act_live_data, &_exp_live_data); ! _g1h->heap_region_par_iterate(&cl, worker_id, &_hr_claimer); Atomic::add(cl.failures(), &_failures); } int failures() const { return _failures; } --- 529,558 ---- G1CardLiveData _exp_live_data; int _failures; public: G1VerifyCardLiveDataTask(G1CMBitMap* bitmap, G1CardLiveData* act_live_data, uint n_workers) ! : 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) { assert(VerifyDuringGC, "don't call this otherwise"); _exp_live_data.initialize(_g1h->max_capacity(), _g1h->max_regions()); } void work(uint worker_id) { G1VerifyCardLiveDataClosure cl(_g1h, _mark_bitmap, _act_live_data, &_exp_live_data); ! all_heap_regions_work(&cl, worker_id); Atomic::add(cl.failures(), &_failures); } int failures() const { return _failures; }