1.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Wed Jun 25 10:55:10 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp Wed Jun 25 16:53:13 2014 +0200 1.3 @@ -52,8 +52,8 @@ 1.4 // consolidation. 1.5 1.6 // Forward declarations 1.7 -class ContiguousSpace; 1.8 class G1BlockOffsetSharedArray; 1.9 +class G1OffsetTableContigSpace; 1.10 1.11 class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC { 1.12 friend class VMStructs; 1.13 @@ -157,6 +157,8 @@ 1.14 return _offset_array[index]; 1.15 } 1.16 1.17 + void set_offset_array(HeapWord* left, HeapWord* right, u_char offset); 1.18 + 1.19 void set_offset_array(size_t index, u_char offset) { 1.20 check_index(index, "index out of range"); 1.21 check_offset(offset, "offset too large"); 1.22 @@ -170,21 +172,6 @@ 1.23 _offset_array[index] = (u_char) pointer_delta(high, low); 1.24 } 1.25 1.26 - void set_offset_array(HeapWord* left, HeapWord* right, u_char offset) { 1.27 - check_index(index_for(right - 1), "right address out of range"); 1.28 - assert(left < right, "Heap addresses out of order"); 1.29 - size_t num_cards = pointer_delta(right, left) >> LogN_words; 1.30 - if (UseMemSetInBOT) { 1.31 - memset(&_offset_array[index_for(left)], offset, num_cards); 1.32 - } else { 1.33 - size_t i = index_for(left); 1.34 - const size_t end = i + num_cards; 1.35 - for (; i < end; i++) { 1.36 - _offset_array[i] = offset; 1.37 - } 1.38 - } 1.39 - } 1.40 - 1.41 void set_offset_array(size_t left, size_t right, u_char offset) { 1.42 check_index(right, "right index out of range"); 1.43 assert(left <= right, "indexes out of order"); 1.44 @@ -281,11 +268,7 @@ 1.45 G1BlockOffsetSharedArray* _array; 1.46 1.47 // The space that owns this subregion. 1.48 - Space* _sp; 1.49 - 1.50 - // If "_sp" is a contiguous space, the field below is the view of "_sp" 1.51 - // as a contiguous space, else NULL. 1.52 - ContiguousSpace* _csp; 1.53 + G1OffsetTableContigSpace* _gsp; 1.54 1.55 // If true, array entries are initialized to 0; otherwise, they are 1.56 // initialized to point backwards to the beginning of the covered region. 1.57 @@ -310,7 +293,9 @@ 1.58 1.59 protected: 1.60 1.61 - ContiguousSpace* csp() const { return _csp; } 1.62 + G1OffsetTableContigSpace* gsp() const { return _gsp; } 1.63 + 1.64 + inline size_t block_size(const HeapWord* p) const; 1.65 1.66 // Returns the address of a block whose start is at most "addr". 1.67 // If "has_max_index" is true, "assumes "max_index" is the last valid one 1.68 @@ -363,7 +348,7 @@ 1.69 // "this" to be passed as a parameter to a member constructor for 1.70 // the containing concrete subtype of Space. 1.71 // This would be legal C++, but MS VC++ doesn't allow it. 1.72 - void set_space(Space* sp); 1.73 + void set_space(G1OffsetTableContigSpace* sp); 1.74 1.75 // Resets the covered region to the given "mr". 1.76 void set_region(MemRegion mr);