Print this page
rev 6587 : 8047820: G1 Block offset table does not need to support generic Space classes

@@ -50,12 +50,12 @@
 // that compilers might normally perform in the case of non-G1
 // collectors needs to be carefully investigated prior to any such
 // consolidation.
 // Forward declarations
-class ContiguousSpace;
 class G1BlockOffsetSharedArray;
+class G1OffsetTableContigSpace;
 class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC {
   friend class VMStructs;
   // These members describe the region covered by the table.

@@ -279,15 +279,11 @@
   // This is the array, which can be shared by several BlockOffsetArray's
   // servicing different
   G1BlockOffsetSharedArray* _array;
   // The space that owns this subregion.
-  Space* _sp;
-  // If "_sp" is a contiguous space, the field below is the view of "_sp"
-  // as a contiguous space, else NULL.
-  ContiguousSpace* _csp;
+  G1OffsetTableContigSpace* _gsp;
   // If true, array entries are initialized to 0; otherwise, they are
   // initialized to point backwards to the beginning of the covered region.
   bool _init_to_zero;

@@ -308,11 +304,13 @@
   // A helper function for BOT adjustment/verification work
   void do_block_internal(HeapWord* blk_start, HeapWord* blk_end, Action action);
-  ContiguousSpace* csp() const { return _csp; }
+  G1OffsetTableContigSpace* gsp() const { return _gsp; }
+  inline size_t block_size(const HeapWord* p) const;
   // Returns the address of a block whose start is at most "addr".
   // If "has_max_index" is true, "assumes "max_index" is the last valid one
   // in the array.
   inline HeapWord* block_at_or_preceding(const void* addr,

@@ -361,11 +359,11 @@
   // Note: this ought to be part of the constructor, but that would require
   // "this" to be passed as a parameter to a member constructor for
   // the containing concrete subtype of Space.
   // This would be legal C++, but MS VC++ doesn't allow it.
-  void set_space(Space* sp);
+  void set_space(G1OffsetTableContigSpace* sp);
   // Resets the covered region to the given "mr".
   void set_region(MemRegion mr);
   // Resets the covered region to one with the same _bottom as before but