--- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2012-09-21 16:29:11.824563931 -0700 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2012-09-21 16:29:11.477898272 -0700 @@ -1192,25 +1192,7 @@ BitMap* _region_bm; BitMap* _card_bm; - void set_card_bitmap_range(BitMap::idx_t start_idx, BitMap::idx_t last_idx) { - assert(start_idx <= last_idx, "sanity"); - - // Set the inclusive bit range [start_idx, last_idx]. - // For small ranges (up to 8 cards) use a simple loop; otherwise - // use par_at_put_range. - if ((last_idx - start_idx) < 8) { - for (BitMap::idx_t i = start_idx; i <= last_idx; i += 1) { - _card_bm->par_set_bit(i); - } - } else { - assert(last_idx < _card_bm->size(), "sanity"); - // Note BitMap::par_at_put_range() is exclusive. - BitMap::idx_t max_idx = MAX2(last_idx+1, _card_bm->size()); - _card_bm->par_at_put_range(start_idx, max_idx, true); - } - } - - // It takes a region that's not empty (i.e., it has at least one + // Takes a region that's not empty (i.e., it has at least one // live object in it and sets its corresponding bit on the region // bitmap to 1. If the region is "starts humongous" it will also set // to 1 the bits on the region bitmap that correspond to its @@ -1283,7 +1265,7 @@ BitMap::idx_t last_idx = _cm->card_bitmap_index_for(obj_last); // Set the bits in the card BM for this object (inclusive). - set_card_bitmap_range(start_idx, last_idx); + _cm->set_card_bitmap_range(_card_bm, start_idx, last_idx, true /* is_par */); // Add the size of this object to the number of marked bytes. marked_bytes += (size_t)obj_sz * HeapWordSize; @@ -1298,7 +1280,7 @@ BitMap::idx_t start_idx = _cm->card_bitmap_index_for(nextTop); BitMap::idx_t last_idx = _cm->card_bitmap_index_for(top - 1); - set_card_bitmap_range(start_idx, last_idx); + _cm->set_card_bitmap_range(_card_bm, start_idx, last_idx, true /* is_par */); // This definitely means the region has live objects. set_bit_for_region(hr); @@ -1552,13 +1534,14 @@ // Now set the bits for [ntams, top] BitMap::idx_t start_idx = _cm->card_bitmap_index_for(ntams); - // set_card_bitmap_range() expects the last_idx to be with - // the range of the bit map (see assertion in set_card_bitmap_range()), - // so limit it to that range with this application of MIN2. + // The utility routine set_card_bitmap_range() expects last_idx + // to be within the range of the bit map (see assertion in + // set_card_bitmap_range()), so limit last_idx to that range + // with this application of MIN2. BitMap::idx_t last_idx = MIN2(_cm->card_bitmap_index_for(top), _card_bm->size()-1); if (start_idx < _card_bm->size()) { - set_card_bitmap_range(start_idx, last_idx); + _cm->set_card_bitmap_range(_card_bm, start_idx, last_idx, true /* is_par */); } else { // To reach here start_idx must be beyond the end of // the bit map and last_idx must have been limited by