Mercurial > hg > graal-compiler
diff src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 5988:2a0172480595
7127697: G1: remove dead code after recent concurrent mark changes
Summary: Removed lots of dead code after some recent conc mark changes.
Reviewed-by: brutisso, johnc
author | tonyp |
---|---|
date | Thu, 05 Apr 2012 13:57:23 -0400 |
parents | 748051fd24ce |
children | b632e80fc9dc |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Fri Mar 16 09:52:57 2012 +0100 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Apr 05 13:57:23 2012 -0400 @@ -1677,202 +1677,6 @@ size_t _max_heap_capacity; }; -#define use_local_bitmaps 1 -#define verify_local_bitmaps 0 -#define oop_buffer_length 256 - -#ifndef PRODUCT -class GCLabBitMap; -class GCLabBitMapClosure: public BitMapClosure { -private: - ConcurrentMark* _cm; - GCLabBitMap* _bitmap; - -public: - GCLabBitMapClosure(ConcurrentMark* cm, - GCLabBitMap* bitmap) { - _cm = cm; - _bitmap = bitmap; - } - - virtual bool do_bit(size_t offset); -}; -#endif // !PRODUCT - -class GCLabBitMap: public BitMap { -private: - ConcurrentMark* _cm; - - int _shifter; - size_t _bitmap_word_covers_words; - - // beginning of the heap - HeapWord* _heap_start; - - // this is the actual start of the GCLab - HeapWord* _real_start_word; - - // this is the actual end of the GCLab - HeapWord* _real_end_word; - - // this is the first word, possibly located before the actual start - // of the GCLab, that corresponds to the first bit of the bitmap - HeapWord* _start_word; - - // size of a GCLab in words - size_t _gclab_word_size; - - static int shifter() { - return MinObjAlignment - 1; - } - - // how many heap words does a single bitmap word corresponds to? - static size_t bitmap_word_covers_words() { - return BitsPerWord << shifter(); - } - - size_t gclab_word_size() const { - return _gclab_word_size; - } - - // Calculates actual GCLab size in words - size_t gclab_real_word_size() const { - return bitmap_size_in_bits(pointer_delta(_real_end_word, _start_word)) - / BitsPerWord; - } - - static size_t bitmap_size_in_bits(size_t gclab_word_size) { - size_t bits_in_bitmap = gclab_word_size >> shifter(); - // We are going to ensure that the beginning of a word in this - // bitmap also corresponds to the beginning of a word in the - // global marking bitmap. To handle the case where a GCLab - // starts from the middle of the bitmap, we need to add enough - // space (i.e. up to a bitmap word) to ensure that we have - // enough bits in the bitmap. - return bits_in_bitmap + BitsPerWord - 1; - } -public: - GCLabBitMap(HeapWord* heap_start, size_t gclab_word_size) - : BitMap(bitmap_size_in_bits(gclab_word_size)), - _cm(G1CollectedHeap::heap()->concurrent_mark()), - _shifter(shifter()), - _bitmap_word_covers_words(bitmap_word_covers_words()), - _heap_start(heap_start), - _gclab_word_size(gclab_word_size), - _real_start_word(NULL), - _real_end_word(NULL), - _start_word(NULL) { - guarantee(false, "GCLabBitMap::GCLabBitmap(): don't call this any more"); - } - - inline unsigned heapWordToOffset(HeapWord* addr) { - unsigned offset = (unsigned) pointer_delta(addr, _start_word) >> _shifter; - assert(offset < size(), "offset should be within bounds"); - return offset; - } - - inline HeapWord* offsetToHeapWord(size_t offset) { - HeapWord* addr = _start_word + (offset << _shifter); - assert(_real_start_word <= addr && addr < _real_end_word, "invariant"); - return addr; - } - - bool fields_well_formed() { - bool ret1 = (_real_start_word == NULL) && - (_real_end_word == NULL) && - (_start_word == NULL); - if (ret1) - return true; - - bool ret2 = _real_start_word >= _start_word && - _start_word < _real_end_word && - (_real_start_word + _gclab_word_size) == _real_end_word && - (_start_word + _gclab_word_size + _bitmap_word_covers_words) - > _real_end_word; - return ret2; - } - - inline bool mark(HeapWord* addr) { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - if (addr >= _real_start_word && addr < _real_end_word) { - assert(!isMarked(addr), "should not have already been marked"); - - // first mark it on the bitmap - at_put(heapWordToOffset(addr), true); - - return true; - } else { - return false; - } - } - - inline bool isMarked(HeapWord* addr) { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - return at(heapWordToOffset(addr)); - } - - void set_buffer(HeapWord* start) { - guarantee(false, "set_buffer(): don't call this any more"); - - guarantee(use_local_bitmaps, "invariant"); - clear(); - - assert(start != NULL, "invariant"); - _real_start_word = start; - _real_end_word = start + _gclab_word_size; - - size_t diff = - pointer_delta(start, _heap_start) % _bitmap_word_covers_words; - _start_word = start - diff; - - assert(fields_well_formed(), "invariant"); - } - -#ifndef PRODUCT - void verify() { - // verify that the marks have been propagated - GCLabBitMapClosure cl(_cm, this); - iterate(&cl); - } -#endif // PRODUCT - - void retire() { - guarantee(false, "retire(): don't call this any more"); - - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - if (_start_word != NULL) { - CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); - - // this means that the bitmap was set up for the GCLab - assert(_real_start_word != NULL && _real_end_word != NULL, "invariant"); - - mark_bitmap->mostly_disjoint_range_union(this, - 0, // always start from the start of the bitmap - _start_word, - gclab_real_word_size()); - _cm->grayRegionIfNecessary(MemRegion(_real_start_word, _real_end_word)); - -#ifndef PRODUCT - if (use_local_bitmaps && verify_local_bitmaps) - verify(); -#endif // PRODUCT - } else { - assert(_real_start_word == NULL && _real_end_word == NULL, "invariant"); - } - } - - size_t bitmap_size_in_words() const { - return (bitmap_size_in_bits(gclab_word_size()) + BitsPerWord - 1) / BitsPerWord; - } - -}; - class G1ParGCAllocBuffer: public ParGCAllocBuffer { private: bool _retired;