src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page

        

*** 617,630 **** CMSConcurrentMTEnabled = false; } } if (!CMSConcurrentMTEnabled) { ParallelCMSThreads = 0; - } else { - // Turn off CMSCleanOnEnter optimization temporarily for - // the MT case where it's not fixed yet; see 6178663. - CMSCleanOnEnter = false; } assert((_conc_workers != NULL) == (ParallelCMSThreads > 1), "Inconsistency"); // Parallel task queues; these are shared for the --- 617,626 ----
*** 6892,6926 **** // this is an allocated but not yet initialized object assert(_skipBits == 0, "tautology"); _skipBits = 2; // skip next two marked bits ("Printezis-marks") oop p = oop(addr); if (p->klass_or_null() == NULL || !p->is_parsable()) { - DEBUG_ONLY(if (!_verifying) {) - // We re-dirty the cards on which this object lies and increase - // the _threshold so that we'll come back to scan this object - // during the preclean or remark phase. (CMSCleanOnEnter) - if (CMSCleanOnEnter) { - size_t sz = _collector->block_size_using_printezis_bits(addr); - HeapWord* end_card_addr = (HeapWord*)round_to( - (intptr_t)(addr+sz), CardTableModRefBS::card_size); - MemRegion redirty_range = MemRegion(addr, end_card_addr); - assert(!redirty_range.is_empty(), "Arithmetical tautology"); - // Bump _threshold to end_card_addr; note that - // _threshold cannot possibly exceed end_card_addr, anyhow. - // This prevents future clearing of the card as the scan proceeds - // to the right. - assert(_threshold <= end_card_addr, - "Because we are just scanning into this object"); - if (_threshold < end_card_addr) { - _threshold = end_card_addr; - } - if (p->klass_or_null() != NULL) { - // Redirty the range of cards... - _mut->mark_range(redirty_range); - } // ...else the setting of klass will dirty the card anyway. - } - DEBUG_ONLY(}) return true; } } scanOopsInOop(addr); return true; --- 6888,6897 ----
*** 6982,7015 **** // us cross into a new card, and if so clear corresponding // cards in the MUT (preclean them in the card-table in the // future). DEBUG_ONLY(if (!_verifying) {) - // The clean-on-enter optimization is disabled by default, - // until we fix 6178663. if (CMSCleanOnEnter && (_finger > _threshold)) { ! // [_threshold, _finger) represents the interval ! // of cards to be cleared in MUT (or precleaned in card table). ! // The set of cards to be cleared is all those that overlap ! // with the interval [_threshold, _finger); note that ! // _threshold is always kept card-aligned but _finger isn't ! // always card-aligned. ! HeapWord* old_threshold = _threshold; ! assert(old_threshold == (HeapWord*)round_to( ! (intptr_t)old_threshold, CardTableModRefBS::card_size), "_threshold should always be card-aligned"); _threshold = (HeapWord*)round_to( (intptr_t)_finger, CardTableModRefBS::card_size); ! MemRegion mr(old_threshold, _threshold); ! assert(!mr.is_empty(), "Control point invariant"); assert(_span.contains(mr), "Should clear within span"); - // XXX When _finger crosses from old gen into perm gen - // we may be doing unnecessary cleaning; do better in the - // future by detecting that condition and clearing fewer - // MUT/CT entries. _mut->clear_range(mr); } DEBUG_ONLY(}) // Note: the finger doesn't advance while we drain // the stack below. PushOrMarkClosure pushOrMarkClosure(_collector, --- 6953,6981 ---- // us cross into a new card, and if so clear corresponding // cards in the MUT (preclean them in the card-table in the // future). DEBUG_ONLY(if (!_verifying) {) if (CMSCleanOnEnter && (_finger > _threshold)) { ! // When marking enters a card for the first time, ! // we can clear the card just entered, because we will ! // be scanning it. The field _threshold keeps track of ! // the end of the last card we may have cleared in ! // this manner. ! assert(_threshold == (HeapWord*)round_to( ! (intptr_t)_threshold, CardTableModRefBS::card_size), "_threshold should always be card-aligned"); _threshold = (HeapWord*)round_to( (intptr_t)_finger, CardTableModRefBS::card_size); ! HeapWord* bot_addr = (HeapWord*)round_to( ! (intptr_t)ptr, CardTableModRefBS::card_size); ! MemRegion mr(bot_addr, _threshold); ! if (!mr.is_empty()) { assert(_span.contains(mr), "Should clear within span"); _mut->clear_range(mr); } + } DEBUG_ONLY(}) // Note: the finger doesn't advance while we drain // the stack below. PushOrMarkClosure pushOrMarkClosure(_collector,
*** 7095,7139 **** assert(obj->is_oop(true), "should be an oop"); assert(_finger <= ptr, "_finger runneth ahead"); // advance the finger to right end of this object _finger = ptr + obj->size(); assert(_finger > ptr, "we just incremented it above"); - // On large heaps, it may take us some time to get through - // the marking phase (especially if running iCMS). During - // this time it's possible that a lot of mutations have - // accumulated in the card table and the mod union table -- - // these mutation records are redundant until we have - // actually traced into the corresponding card. - // Here, we check whether advancing the finger would make - // us cross into a new card, and if so clear corresponding - // cards in the MUT (preclean them in the card-table in the - // future). ! // The clean-on-enter optimization is disabled by default, ! // until we fix 6178663. ! if (CMSCleanOnEnter && (_finger > _threshold)) { ! // [_threshold, _finger) represents the interval ! // of cards to be cleared in MUT (or precleaned in card table). ! // The set of cards to be cleared is all those that overlap ! // with the interval [_threshold, _finger); note that ! // _threshold is always kept card-aligned but _finger isn't ! // always card-aligned. ! HeapWord* old_threshold = _threshold; ! assert(old_threshold == (HeapWord*)round_to( ! (intptr_t)old_threshold, CardTableModRefBS::card_size), ! "_threshold should always be card-aligned"); ! _threshold = (HeapWord*)round_to( ! (intptr_t)_finger, CardTableModRefBS::card_size); ! MemRegion mr(old_threshold, _threshold); ! assert(!mr.is_empty(), "Control point invariant"); ! assert(_span.contains(mr), "Should clear within span"); // _whole_span ?? ! // XXX When _finger crosses from old gen into perm gen ! // we may be doing unnecessary cleaning; do better in the ! // future by detecting that condition and clearing fewer ! // MUT/CT entries. ! _mut->clear_range(mr); ! } // Note: the local finger doesn't advance while we drain // the stack below, but the global finger sure can and will. HeapWord** gfa = _task->global_finger_addr(); Par_PushOrMarkClosure pushOrMarkClosure(_collector, --- 7061,7073 ---- assert(obj->is_oop(true), "should be an oop"); assert(_finger <= ptr, "_finger runneth ahead"); // advance the finger to right end of this object _finger = ptr + obj->size(); assert(_finger > ptr, "we just incremented it above"); ! // Turn off CMSCleanOnEnter optimization temporarily for ! // the MT case where it's not fixed yet; see 6178663. // Note: the local finger doesn't advance while we drain // the stack below, but the global finger sure can and will. HeapWord** gfa = _task->global_finger_addr(); Par_PushOrMarkClosure pushOrMarkClosure(_collector,