1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Aug 31 16:39:35 2012 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Sat Sep 01 13:25:18 2012 -0400 1.3 @@ -315,9 +315,7 @@ 1.4 } 1.5 1.6 bool ConcurrentMark::not_yet_marked(oop obj) const { 1.7 - return (_g1h->is_obj_ill(obj) 1.8 - || (_g1h->is_in_permanent(obj) 1.9 - && !nextMarkBitMap()->isMarked((HeapWord*)obj))); 1.10 + return _g1h->is_obj_ill(obj); 1.11 } 1.12 1.13 CMRootRegions::CMRootRegions() : 1.14 @@ -1207,7 +1205,8 @@ 1.15 } else { 1.16 assert(last_idx < _card_bm->size(), "sanity"); 1.17 // Note BitMap::par_at_put_range() is exclusive. 1.18 - _card_bm->par_at_put_range(start_idx, last_idx+1, true); 1.19 + BitMap::idx_t max_idx = MAX2(last_idx+1, _card_bm->size()); 1.20 + _card_bm->par_at_put_range(start_idx, max_idx, true); 1.21 } 1.22 } 1.23 1.24 @@ -1553,8 +1552,21 @@ 1.25 1.26 // Now set the bits for [ntams, top] 1.27 BitMap::idx_t start_idx = _cm->card_bitmap_index_for(ntams); 1.28 - BitMap::idx_t last_idx = _cm->card_bitmap_index_for(top); 1.29 + // set_card_bitmap_range() expects the last_idx to be with 1.30 + // the range of the bit map (see assertion in set_card_bitmap_range()), 1.31 + // so limit it to that range with this application of MIN2. 1.32 + BitMap::idx_t last_idx = MIN2(_cm->card_bitmap_index_for(top), 1.33 + _card_bm->size()-1); 1.34 + if (start_idx < _card_bm->size()) { 1.35 set_card_bitmap_range(start_idx, last_idx); 1.36 + } else { 1.37 + // To reach here start_idx must be beyond the end of 1.38 + // the bit map and last_idx must have been limited by 1.39 + // the MIN2(). 1.40 + assert(start_idx == last_idx + 1, 1.41 + err_msg("Not beyond end start_idx " SIZE_FORMAT " last_idx " 1.42 + SIZE_FORMAT, start_idx, last_idx)); 1.43 + } 1.44 1.45 // Set the bit for the region if it contains live data 1.46 if (hr->next_marked_bytes() > 0) { 1.47 @@ -2011,7 +2023,7 @@ 1.48 (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj)); 1.49 } 1.50 1.51 -class G1CMKeepAliveClosure: public OopClosure { 1.52 +class G1CMKeepAliveClosure: public ExtendedOopClosure { 1.53 G1CollectedHeap* _g1; 1.54 ConcurrentMark* _cm; 1.55 public: 1.56 @@ -2052,7 +2064,7 @@ 1.57 _oopClosure(oopClosure) { } 1.58 1.59 void do_void() { 1.60 - _markStack->drain((OopClosure*)_oopClosure, _cm->nextMarkBitMap(), false); 1.61 + _markStack->drain(_oopClosure, _cm->nextMarkBitMap(), false); 1.62 } 1.63 }; 1.64 1.65 @@ -2494,7 +2506,7 @@ 1.66 _out->print_cr(" "PTR_FORMAT"%s", 1.67 o, (over_tams) ? " >" : (marked) ? " M" : ""); 1.68 PrintReachableOopClosure oopCl(_out, _vo, _all); 1.69 - o->oop_iterate(&oopCl); 1.70 + o->oop_iterate_no_header(&oopCl); 1.71 } 1.72 } 1.73 };