This commit is contained in:
David Lindholm 2015-11-09 11:35:45 +00:00
commit 333927f512
4 changed files with 26 additions and 33 deletions

View File

@ -1780,7 +1780,6 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
CollectedHeap(),
_g1_policy(policy_),
_dirty_card_queue_set(false),
_into_cset_dirty_card_queue_set(false),
_is_alive_closure_cm(this),
_is_alive_closure_stw(this),
_ref_processor_cm(NULL),
@ -2045,16 +2044,6 @@ jint G1CollectedHeap::initialize() {
Shared_DirtyCardQ_lock,
&JavaThread::dirty_card_queue_set());
// Initialize the card queue set used to hold cards containing
// references into the collection set.
_into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code
DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
-1, // never trigger processing
-1, // no limit on length
Shared_DirtyCardQ_lock,
&JavaThread::dirty_card_queue_set());
// Here we allocate the dummy HeapRegion that is required by the
// G1AllocRegion class.
HeapRegion* dummy_region = _hrm.get_dummy_region();

View File

@ -757,12 +757,6 @@ protected:
// The closure used to refine a single card.
RefineCardTableEntryClosure* _refine_cte_cl;
// A DirtyCardQueueSet that is used to hold cards that contain
// references into the current collection set. This is used to
// update the remembered sets of the regions in the collection
// set in the event of an evacuation failure.
DirtyCardQueueSet _into_cset_dirty_card_queue_set;
// After a collection pause, make the regions in the CS into free
// regions.
void free_collection_set(HeapRegion* cs_head, EvacuationInfo& evacuation_info, const size_t* surviving_young_words);
@ -952,13 +946,6 @@ public:
// A set of cards where updates happened during the GC
DirtyCardQueueSet& dirty_card_queue_set() { return _dirty_card_queue_set; }
// A DirtyCardQueueSet that is used to hold cards that contain
// references into the current collection set. This is used to
// update the remembered sets of the regions in the collection
// set in the event of an evacuation failure.
DirtyCardQueueSet& into_cset_dirty_card_queue_set()
{ return _into_cset_dirty_card_queue_set; }
// Create a G1CollectedHeap with the specified policy.
// Must call the initialize method afterwards.
// May not return if something goes wrong.

View File

@ -45,7 +45,8 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
_ct_bs(ct_bs), _g1p(_g1->g1_policy()),
_cg1r(g1->concurrent_g1_refine()),
_cset_rs_update_cl(NULL),
_prev_period_summary()
_prev_period_summary(),
_into_cset_dirty_card_queue_set(false)
{
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
for (uint i = 0; i < n_workers(); i++) {
@ -54,6 +55,15 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
if (G1SummarizeRSetStats) {
_prev_period_summary.initialize(this);
}
// Initialize the card queue set used to hold cards containing
// references into the collection set.
_into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code
DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
-1, // never trigger processing
-1, // no limit on length
Shared_DirtyCardQ_lock,
&JavaThread::dirty_card_queue_set());
}
G1RemSet::~G1RemSet() {
@ -242,7 +252,7 @@ public:
if (_g1rs->refine_card(card_ptr, worker_i, true)) {
// 'card_ptr' contains references that point into the collection
// set. We need to record the card in the DCQS
// (G1CollectedHeap::into_cset_dirty_card_queue_set())
// (_into_cset_dirty_card_queue_set)
// that's used for that purpose.
//
// Enqueue the card
@ -286,7 +296,7 @@ size_t G1RemSet::oops_into_collection_set_do(G1ParPushHeapRSClosure* oc,
// are wholly 'free' of live objects. In the event of an evacuation
// failure the cards/buffers in this queue set are passed to the
// DirtyCardQueueSet that is used to manage RSet updates
DirtyCardQueue into_cset_dcq(&_g1->into_cset_dirty_card_queue_set());
DirtyCardQueue into_cset_dcq(&_into_cset_dirty_card_queue_set);
updateRS(&into_cset_dcq, worker_i);
size_t cards_scanned = scanRS(oc, heap_region_codeblobs, worker_i);
@ -309,7 +319,7 @@ void G1RemSet::cleanup_after_oops_into_collection_set_do() {
// Set all cards back to clean.
_g1->cleanUpCardTable();
DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set();
DirtyCardQueueSet& into_cset_dcqs = _into_cset_dirty_card_queue_set;
int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num();
if (_g1->evacuation_failed()) {
@ -325,10 +335,10 @@ void G1RemSet::cleanup_after_oops_into_collection_set_do() {
// Free any completed buffers in the DirtyCardQueueSet used to hold cards
// which contain references that point into the collection.
_g1->into_cset_dirty_card_queue_set().clear();
assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0,
_into_cset_dirty_card_queue_set.clear();
assert(_into_cset_dirty_card_queue_set.completed_buffers_num() == 0,
"all buffers should be freed");
_g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers();
_into_cset_dirty_card_queue_set.clear_n_completed_buffers();
}
class ScrubRSClosure: public HeapRegionClosure {
@ -586,9 +596,9 @@ void G1RemSet::prepare_for_verify() {
bool use_hot_card_cache = hot_card_cache->use_cache();
hot_card_cache->set_use_cache(false);
DirtyCardQueue into_cset_dcq(&_g1->into_cset_dirty_card_queue_set());
DirtyCardQueue into_cset_dcq(&_into_cset_dirty_card_queue_set);
updateRS(&into_cset_dcq, 0);
_g1->into_cset_dirty_card_queue_set().clear();
_into_cset_dirty_card_queue_set.clear();
hot_card_cache->set_use_cache(use_hot_card_cache);
assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed");

View File

@ -41,6 +41,13 @@ class G1ParPushHeapRSClosure;
class G1RemSet: public CHeapObj<mtGC> {
private:
G1RemSetSummary _prev_period_summary;
// A DirtyCardQueueSet that is used to hold cards that contain
// references into the current collection set. This is used to
// update the remembered sets of the regions in the collection
// set in the event of an evacuation failure.
DirtyCardQueueSet _into_cset_dirty_card_queue_set;
protected:
G1CollectedHeap* _g1;
size_t _conc_refine_cards;