1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Mon May 13 09:45:33 2013 +0200 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Mon May 13 14:09:05 2013 +0200 1.3 @@ -26,11 +26,11 @@ 1.4 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP 1.5 1.6 #include "memory/memRegion.hpp" 1.7 -#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" 1.8 -#include "utilities/bitMap.inline.hpp" 1.9 +#include "oops/oop.hpp" 1.10 +#include "utilities/bitMap.hpp" 1.11 1.12 -class oopDesc; 1.13 class ParMarkBitMapClosure; 1.14 +class PSVirtualSpace; 1.15 1.16 class ParMarkBitMap: public CHeapObj<mtGC> 1.17 { 1.18 @@ -41,13 +41,11 @@ 1.19 enum IterationStatus { incomplete, complete, full, would_overflow }; 1.20 1.21 inline ParMarkBitMap(); 1.22 - inline ParMarkBitMap(MemRegion covered_region); 1.23 bool initialize(MemRegion covered_region); 1.24 1.25 // Atomically mark an object as live. 1.26 bool mark_obj(HeapWord* addr, size_t size); 1.27 inline bool mark_obj(oop obj, int size); 1.28 - inline bool mark_obj(oop obj); 1.29 1.30 // Return whether the specified begin or end bit is set. 1.31 inline bool is_obj_beg(idx_t bit) const; 1.32 @@ -77,11 +75,6 @@ 1.33 // Return the size in words of the object (a search is done for the end bit). 1.34 inline size_t obj_size(idx_t beg_bit) const; 1.35 inline size_t obj_size(HeapWord* addr) const; 1.36 - inline size_t obj_size(oop obj) const; 1.37 - 1.38 - // Synonyms for the above. 1.39 - size_t obj_size_in_words(oop obj) const { return obj_size((HeapWord*)obj); } 1.40 - size_t obj_size_in_words(HeapWord* addr) const { return obj_size(addr); } 1.41 1.42 // Apply live_closure to each live object that lies completely within the 1.43 // range [live_range_beg, live_range_end). This is used to iterate over the 1.44 @@ -124,15 +117,12 @@ 1.45 HeapWord* range_end, 1.46 HeapWord* dead_range_end) const; 1.47 1.48 - // Return the number of live words in the range [beg_addr, end_addr) due to 1.49 + // Return the number of live words in the range [beg_addr, end_obj) due to 1.50 // objects that start in the range. If a live object extends onto the range, 1.51 // the caller must detect and account for any live words due to that object. 1.52 // If a live object extends beyond the end of the range, only the words within 1.53 - // the range are included in the result. 1.54 - size_t live_words_in_range(HeapWord* beg_addr, HeapWord* end_addr) const; 1.55 - 1.56 - // Same as the above, except the end of the range must be a live object, which 1.57 - // is the case when updating pointers. This allows a branch to be removed 1.58 + // the range are included in the result. The end of the range must be a live object, 1.59 + // which is the case when updating pointers. This allows a branch to be removed 1.60 // from inside the loop. 1.61 size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; 1.62 1.63 @@ -156,22 +146,11 @@ 1.64 // Clear a range of bits or the entire bitmap (both begin and end bits are 1.65 // cleared). 1.66 inline void clear_range(idx_t beg, idx_t end); 1.67 - inline void clear() { clear_range(0, size()); } 1.68 1.69 // Return the number of bits required to represent the specified number of 1.70 // HeapWords, or the specified region. 1.71 static inline idx_t bits_required(size_t words); 1.72 static inline idx_t bits_required(MemRegion covered_region); 1.73 - static inline idx_t words_required(MemRegion covered_region); 1.74 - 1.75 -#ifndef PRODUCT 1.76 - // CAS statistics. 1.77 - size_t cas_tries() { return _cas_tries; } 1.78 - size_t cas_retries() { return _cas_retries; } 1.79 - size_t cas_by_another() { return _cas_by_another; } 1.80 - 1.81 - void reset_counters(); 1.82 -#endif // #ifndef PRODUCT 1.83 1.84 void print_on_error(outputStream* st) const { 1.85 st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this); 1.86 @@ -197,28 +176,11 @@ 1.87 BitMap _beg_bits; 1.88 BitMap _end_bits; 1.89 PSVirtualSpace* _virtual_space; 1.90 - 1.91 -#ifndef PRODUCT 1.92 - size_t _cas_tries; 1.93 - size_t _cas_retries; 1.94 - size_t _cas_by_another; 1.95 -#endif // #ifndef PRODUCT 1.96 }; 1.97 1.98 inline ParMarkBitMap::ParMarkBitMap(): 1.99 - _beg_bits(), 1.100 - _end_bits() 1.101 -{ 1.102 - _region_start = 0; 1.103 - _virtual_space = 0; 1.104 -} 1.105 - 1.106 -inline ParMarkBitMap::ParMarkBitMap(MemRegion covered_region): 1.107 - _beg_bits(), 1.108 - _end_bits() 1.109 -{ 1.110 - initialize(covered_region); 1.111 -} 1.112 + _beg_bits(), _end_bits(), _region_start(NULL), _region_size(0), _virtual_space(NULL) 1.113 +{ } 1.114 1.115 inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) 1.116 { 1.117 @@ -240,12 +202,6 @@ 1.118 return bits_required(covered_region.word_size()); 1.119 } 1.120 1.121 -inline ParMarkBitMap::idx_t 1.122 -ParMarkBitMap::words_required(MemRegion covered_region) 1.123 -{ 1.124 - return bits_required(covered_region) / BitsPerWord; 1.125 -} 1.126 - 1.127 inline HeapWord* 1.128 ParMarkBitMap::region_start() const 1.129 { 1.130 @@ -350,11 +306,6 @@ 1.131 return obj_size(addr_to_bit(addr)); 1.132 } 1.133 1.134 -inline size_t ParMarkBitMap::obj_size(oop obj) const 1.135 -{ 1.136 - return obj_size((HeapWord*)obj); 1.137 -} 1.138 - 1.139 inline ParMarkBitMap::IterationStatus 1.140 ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure, 1.141 HeapWord* range_beg, 1.142 @@ -435,8 +386,10 @@ 1.143 1.144 inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { 1.145 // Allow one past the last valid address; useful for loop bounds. 1.146 - assert(addr >= region_start(), "addr too small"); 1.147 - assert(addr <= region_start() + region_size(), "addr too big"); 1.148 + assert(addr >= region_start(), 1.149 + err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start())); 1.150 + assert(addr <= region_end(), 1.151 + err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end())); 1.152 } 1.153 #endif // #ifdef ASSERT 1.154