< prev index next >

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

Print this page




  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 {
 108     return _reserved.start() + (index << BOTConstants::LogN_words);
 109   }
 110 };
 111 
 112 class G1BlockOffsetTablePart VALUE_OBJ_CLASS_SPEC {
 113   friend class G1BlockOffsetTable;
 114   friend class VMStructs;
 115 private:
 116   // allocation boundary at which offset array must be updated
 117   HeapWord* _next_offset_threshold;
 118   size_t    _next_offset_index;      // index corresponding to that boundary
 119 
 120   // Indicates if an object can span into this G1BlockOffsetTablePart.
 121   debug_only(bool _object_can_span;)
 122 
 123   // This is the global BlockOffsetTable.
 124   G1BlockOffsetTable* _bot;
 125 
 126   // The space that owns this subregion.
 127   G1ContiguousSpace* _space;
 128 
 129   // Sets the entries
 130   // corresponding to the cards starting at "start" and ending at "end"
 131   // to point back to the card before "start": the interval [start, end)
 132   // is right-open.




  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 {
 108     return _reserved.start() + (index << BOTConstants::LogN_words);
 109   }
 110 };
 111 
 112 class G1BlockOffsetTablePart {
 113   friend class G1BlockOffsetTable;
 114   friend class VMStructs;
 115 private:
 116   // allocation boundary at which offset array must be updated
 117   HeapWord* _next_offset_threshold;
 118   size_t    _next_offset_index;      // index corresponding to that boundary
 119 
 120   // Indicates if an object can span into this G1BlockOffsetTablePart.
 121   debug_only(bool _object_can_span;)
 122 
 123   // This is the global BlockOffsetTable.
 124   G1BlockOffsetTable* _bot;
 125 
 126   // The space that owns this subregion.
 127   G1ContiguousSpace* _space;
 128 
 129   // Sets the entries
 130   // corresponding to the cards starting at "start" and ending at "end"
 131   // to point back to the card before "start": the interval [start, end)
 132   // is right-open.


< prev index next >