< prev index next >

src/share/vm/gc/shared/blockOffsetTable.hpp

Print this page




 211 
 212   void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const {
 213     assert(index < _vs.committed_size(), "index out of range");
 214     assert(high >= low, "addresses out of order");
 215     assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large");
 216     assert(_offset_array[index] == pointer_delta(high, low),
 217            "Wrong offset");
 218   }
 219 
 220   bool is_card_boundary(HeapWord* p) const;
 221 
 222   // Return the number of slots needed for an offset array
 223   // that covers mem_region_words words.
 224   // We always add an extra slot because if an object
 225   // ends on a card boundary we put a 0 in the next
 226   // offset array slot, so we want that slot always
 227   // to be reserved.
 228 
 229   size_t compute_size(size_t mem_region_words) {
 230     size_t number_of_slots = (mem_region_words / BOTConstants::N_words) + 1;
 231     return ReservedSpace::allocation_align_size_up(number_of_slots);
 232   }
 233 
 234 public:
 235   // Initialize the table to cover from "base" to (at least)
 236   // "base + init_word_size".  In the future, the table may be expanded
 237   // (see "resize" below) up to the size of "_reserved" (which must be at
 238   // least "init_word_size".)  The contents of the initial table are
 239   // undefined; it is the responsibility of the constituent
 240   // BlockOffsetTable(s) to initialize cards.
 241   BlockOffsetSharedArray(MemRegion reserved, size_t init_word_size);
 242 
 243   // Notes a change in the committed size of the region covered by the
 244   // table.  The "new_word_size" may not be larger than the size of the
 245   // reserved region this table covers.
 246   void resize(size_t new_word_size);
 247 
 248   void set_bottom(HeapWord* new_bottom);
 249 
 250   // Whether entries should be initialized to zero. Used currently only for
 251   // error checking.




 211 
 212   void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const {
 213     assert(index < _vs.committed_size(), "index out of range");
 214     assert(high >= low, "addresses out of order");
 215     assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large");
 216     assert(_offset_array[index] == pointer_delta(high, low),
 217            "Wrong offset");
 218   }
 219 
 220   bool is_card_boundary(HeapWord* p) const;
 221 
 222   // Return the number of slots needed for an offset array
 223   // that covers mem_region_words words.
 224   // We always add an extra slot because if an object
 225   // ends on a card boundary we put a 0 in the next
 226   // offset array slot, so we want that slot always
 227   // to be reserved.
 228 
 229   size_t compute_size(size_t mem_region_words) {
 230     size_t number_of_slots = (mem_region_words / BOTConstants::N_words) + 1;
 231     return ReservedSpace::allocation_align_up(number_of_slots);
 232   }
 233 
 234 public:
 235   // Initialize the table to cover from "base" to (at least)
 236   // "base + init_word_size".  In the future, the table may be expanded
 237   // (see "resize" below) up to the size of "_reserved" (which must be at
 238   // least "init_word_size".)  The contents of the initial table are
 239   // undefined; it is the responsibility of the constituent
 240   // BlockOffsetTable(s) to initialize cards.
 241   BlockOffsetSharedArray(MemRegion reserved, size_t init_word_size);
 242 
 243   // Notes a change in the committed size of the region covered by the
 244   // table.  The "new_word_size" may not be larger than the size of the
 245   // reserved region this table covers.
 246   void resize(size_t new_word_size);
 247 
 248   void set_bottom(HeapWord* new_bottom);
 249 
 250   // Whether entries should be initialized to zero. Used currently only for
 251   // error checking.


< prev index next >