src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-g1-mmap Cdiff src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp

src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp

Print this page

        

*** 24,55 **** #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP #include "memory/memRegion.hpp" ! #include "gc_implementation/parallelScavenge/psVirtualspace.hpp" ! #include "utilities/bitMap.inline.hpp" - class oopDesc; class ParMarkBitMapClosure; class ParMarkBitMap: public CHeapObj<mtGC> { public: typedef BitMap::idx_t idx_t; // Values returned by the iterate() methods. enum IterationStatus { incomplete, complete, full, would_overflow }; inline ParMarkBitMap(); - inline ParMarkBitMap(MemRegion covered_region); bool initialize(MemRegion covered_region); // Atomically mark an object as live. bool mark_obj(HeapWord* addr, size_t size); inline bool mark_obj(oop obj, int size); - inline bool mark_obj(oop obj); // Return whether the specified begin or end bit is set. inline bool is_obj_beg(idx_t bit) const; inline bool is_obj_end(idx_t bit) const; --- 24,53 ---- #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP #include "memory/memRegion.hpp" ! #include "oops/oop.hpp" ! #include "utilities/bitMap.hpp" class ParMarkBitMapClosure; + class PSVirtualSpace; class ParMarkBitMap: public CHeapObj<mtGC> { public: typedef BitMap::idx_t idx_t; // Values returned by the iterate() methods. enum IterationStatus { incomplete, complete, full, would_overflow }; inline ParMarkBitMap(); bool initialize(MemRegion covered_region); // Atomically mark an object as live. bool mark_obj(HeapWord* addr, size_t size); inline bool mark_obj(oop obj, int size); // Return whether the specified begin or end bit is set. inline bool is_obj_beg(idx_t bit) const; inline bool is_obj_end(idx_t bit) const;
*** 75,89 **** inline size_t obj_size(HeapWord* beg_addr, HeapWord* end_addr) const; // Return the size in words of the object (a search is done for the end bit). inline size_t obj_size(idx_t beg_bit) const; inline size_t obj_size(HeapWord* addr) const; - inline size_t obj_size(oop obj) const; - - // Synonyms for the above. - size_t obj_size_in_words(oop obj) const { return obj_size((HeapWord*)obj); } - size_t obj_size_in_words(HeapWord* addr) const { return obj_size(addr); } // Apply live_closure to each live object that lies completely within the // range [live_range_beg, live_range_end). This is used to iterate over the // compacted region of the heap. Return values: // --- 73,82 ----
*** 122,140 **** ParMarkBitMapClosure* dead_closure, HeapWord* range_beg, HeapWord* range_end, HeapWord* dead_range_end) const; ! // Return the number of live words in the range [beg_addr, end_addr) due to // objects that start in the range. If a live object extends onto the range, // the caller must detect and account for any live words due to that object. // If a live object extends beyond the end of the range, only the words within ! // the range are included in the result. ! size_t live_words_in_range(HeapWord* beg_addr, HeapWord* end_addr) const; ! ! // Same as the above, except the end of the range must be a live object, which ! // is the case when updating pointers. This allows a branch to be removed // from inside the loop. size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; inline HeapWord* region_start() const; inline HeapWord* region_end() const; --- 115,130 ---- ParMarkBitMapClosure* dead_closure, HeapWord* range_beg, HeapWord* range_end, HeapWord* dead_range_end) const; ! // Return the number of live words in the range [beg_addr, end_obj) due to // objects that start in the range. If a live object extends onto the range, // the caller must detect and account for any live words due to that object. // If a live object extends beyond the end of the range, only the words within ! // the range are included in the result. The end of the range must be a live object, ! // which is the case when updating pointers. This allows a branch to be removed // from inside the loop. size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; inline HeapWord* region_start() const; inline HeapWord* region_end() const;
*** 154,179 **** inline HeapWord* find_obj_end(HeapWord* beg, HeapWord* end) const; // Clear a range of bits or the entire bitmap (both begin and end bits are // cleared). inline void clear_range(idx_t beg, idx_t end); - inline void clear() { clear_range(0, size()); } // Return the number of bits required to represent the specified number of // HeapWords, or the specified region. static inline idx_t bits_required(size_t words); static inline idx_t bits_required(MemRegion covered_region); ! static inline idx_t words_required(MemRegion covered_region); ! ! #ifndef PRODUCT ! // CAS statistics. ! size_t cas_tries() { return _cas_tries; } ! size_t cas_retries() { return _cas_retries; } ! size_t cas_by_another() { return _cas_by_another; } ! ! void reset_counters(); ! #endif // #ifndef PRODUCT void print_on_error(outputStream* st) const { st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this); _beg_bits.print_on_error(st, " Begin Bits: "); _end_bits.print_on_error(st, " End Bits: "); --- 144,159 ---- inline HeapWord* find_obj_end(HeapWord* beg, HeapWord* end) const; // Clear a range of bits or the entire bitmap (both begin and end bits are // cleared). inline void clear_range(idx_t beg, idx_t end); // Return the number of bits required to represent the specified number of // HeapWords, or the specified region. static inline idx_t bits_required(size_t words); static inline idx_t bits_required(MemRegion covered_region); ! //static inline idx_t words_required(MemRegion covered_region); void print_on_error(outputStream* st) const { st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this); _beg_bits.print_on_error(st, " Begin Bits: "); _end_bits.print_on_error(st, " End Bits: ");
*** 195,226 **** HeapWord* _region_start; size_t _region_size; BitMap _beg_bits; BitMap _end_bits; PSVirtualSpace* _virtual_space; - - #ifndef PRODUCT - size_t _cas_tries; - size_t _cas_retries; - size_t _cas_by_another; - #endif // #ifndef PRODUCT }; inline ParMarkBitMap::ParMarkBitMap(): ! _beg_bits(), ! _end_bits() ! { ! _region_start = 0; ! _virtual_space = 0; ! } ! ! inline ParMarkBitMap::ParMarkBitMap(MemRegion covered_region): ! _beg_bits(), ! _end_bits() ! { ! initialize(covered_region); ! } inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) { _beg_bits.clear_range(beg, end); _end_bits.clear_range(beg, end); --- 175,189 ---- HeapWord* _region_start; size_t _region_size; BitMap _beg_bits; BitMap _end_bits; PSVirtualSpace* _virtual_space; }; inline ParMarkBitMap::ParMarkBitMap(): ! _beg_bits(), _end_bits(), _region_start(NULL), _region_size(0), _virtual_space(NULL) ! { } inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) { _beg_bits.clear_range(beg, end); _end_bits.clear_range(beg, end);
*** 238,253 **** ParMarkBitMap::bits_required(MemRegion covered_region) { return bits_required(covered_region.word_size()); } - inline ParMarkBitMap::idx_t - ParMarkBitMap::words_required(MemRegion covered_region) - { - return bits_required(covered_region) / BitsPerWord; - } - inline HeapWord* ParMarkBitMap::region_start() const { return _region_start; } --- 201,210 ----
*** 348,362 **** inline size_t ParMarkBitMap::obj_size(HeapWord* addr) const { return obj_size(addr_to_bit(addr)); } - inline size_t ParMarkBitMap::obj_size(oop obj) const - { - return obj_size((HeapWord*)obj); - } - inline ParMarkBitMap::IterationStatus ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure, HeapWord* range_beg, HeapWord* range_end) const { --- 305,314 ----
*** 433,443 **** assert(bit <= _beg_bits.size(), "bit out of range"); } inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { // Allow one past the last valid address; useful for loop bounds. ! assert(addr >= region_start(), "addr too small"); ! assert(addr <= region_start() + region_size(), "addr too big"); } #endif // #ifdef ASSERT #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP --- 385,397 ---- assert(bit <= _beg_bits.size(), "bit out of range"); } inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { // Allow one past the last valid address; useful for loop bounds. ! assert(addr >= region_start(), ! err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start())); ! assert(addr <= region_end(), ! err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end())); } #endif // #ifdef ASSERT #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File