< prev index next >

src/share/vm/gc/g1/g1BlockOffsetTable.hpp

Print this page




  67   void set_offset_array_raw(size_t index, u_char offset) {
  68     _offset_array[index] = offset;
  69   }
  70 
  71   inline void set_offset_array(size_t index, u_char offset);
  72 
  73   inline void set_offset_array(size_t index, HeapWord* high, HeapWord* low);
  74 
  75   inline void set_offset_array(size_t left, size_t right, u_char offset);
  76 
  77   bool is_card_boundary(HeapWord* p) const;
  78 
  79   void check_index(size_t index, const char* msg) const NOT_DEBUG_RETURN;
  80 
  81 public:
  82 
  83   // Return the number of slots needed for an offset array
  84   // that covers mem_region_words words.
  85   static size_t compute_size(size_t mem_region_words) {
  86     size_t number_of_slots = (mem_region_words / BOTConstants::N_words);
  87     return ReservedSpace::allocation_align_size_up(number_of_slots);
  88   }
  89 
  90   // Returns how many bytes of the heap a single byte of the BOT corresponds to.
  91   static size_t heap_map_factor() {
  92     return BOTConstants::N_bytes;
  93   }
  94 
  95   // Initialize the Block Offset Table to cover the memory region passed
  96   // in the heap parameter.
  97   G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage);
  98 
  99   // Return the appropriate index into "_offset_array" for "p".
 100   inline size_t index_for(const void* p) const;
 101   inline size_t index_for_raw(const void* p) const;
 102 
 103   // Return the address indicating the start of the region corresponding to
 104   // "index" in "_offset_array".
 105   inline HeapWord* address_for_index(size_t index) const;
 106   // Variant of address_for_index that does not check the index for validity.
 107   inline HeapWord* address_for_index_raw(size_t index) const {




  67   void set_offset_array_raw(size_t index, u_char offset) {
  68     _offset_array[index] = offset;
  69   }
  70 
  71   inline void set_offset_array(size_t index, u_char offset);
  72 
  73   inline void set_offset_array(size_t index, HeapWord* high, HeapWord* low);
  74 
  75   inline void set_offset_array(size_t left, size_t right, u_char offset);
  76 
  77   bool is_card_boundary(HeapWord* p) const;
  78 
  79   void check_index(size_t index, const char* msg) const NOT_DEBUG_RETURN;
  80 
  81 public:
  82 
  83   // Return the number of slots needed for an offset array
  84   // that covers mem_region_words words.
  85   static size_t compute_size(size_t mem_region_words) {
  86     size_t number_of_slots = (mem_region_words / BOTConstants::N_words);
  87     return ReservedSpace::allocation_align_up(number_of_slots);
  88   }
  89 
  90   // Returns how many bytes of the heap a single byte of the BOT corresponds to.
  91   static size_t heap_map_factor() {
  92     return BOTConstants::N_bytes;
  93   }
  94 
  95   // Initialize the Block Offset Table to cover the memory region passed
  96   // in the heap parameter.
  97   G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage);
  98 
  99   // Return the appropriate index into "_offset_array" for "p".
 100   inline size_t index_for(const void* p) const;
 101   inline size_t index_for_raw(const void* p) const;
 102 
 103   // Return the address indicating the start of the region corresponding to
 104   // "index" in "_offset_array".
 105   inline HeapWord* address_for_index(size_t index) const;
 106   // Variant of address_for_index that does not check the index for validity.
 107   inline HeapWord* address_for_index_raw(size_t index) const {


< prev index next >