@@ -38,19 +38,6 @@ class G1BiasedMappedArrayBase : public CHeapObj<mtGC> {
38
38
39
39
void * _alloc_base; // the address the unpadded array has been allocated to
40
40
41
- public:
42
- typedef size_t idx_t ;
43
-
44
- protected:
45
- address _base; // the real base address
46
- size_t _length; // the length of the array
47
- address _biased_base; // base address biased by "bias" elements
48
- size_t _bias; // the bias, i.e. the offset biased_base is located to the right in elements
49
- uint _shift_by; // the amount of bits to shift right when mapping to an index of the array.
50
-
51
- protected:
52
- G1BiasedMappedArrayBase ();
53
-
54
41
// Allocate a new array, generic version.
55
42
address create_new_base_array (size_t length, size_t elem_size);
56
43
@@ -67,6 +54,18 @@ class G1BiasedMappedArrayBase : public CHeapObj<mtGC> {
67
54
_shift_by = shift_by;
68
55
}
69
56
57
+ public:
58
+ typedef size_t idx_t ;
59
+
60
+ protected:
61
+ address _base; // the real base address
62
+ size_t _length; // the length of the array
63
+ address _biased_base; // base address biased by "bias" elements
64
+ size_t _bias; // the bias, i.e. the offset biased_base is located to the right in elements
65
+ uint _shift_by; // the amount of bits to shift right when mapping to an index of the array.
66
+
67
+ G1BiasedMappedArrayBase ();
68
+
70
69
// Allocate and initialize this array to cover the heap addresses in the range
71
70
// of [bottom, end).
72
71
void initialize (HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) {
@@ -90,7 +89,6 @@ class G1BiasedMappedArrayBase : public CHeapObj<mtGC> {
90
89
91
90
void verify_index (idx_t index) const PRODUCT_RETURN;
92
91
void verify_biased_index (idx_t biased_index) const PRODUCT_RETURN;
93
- void verify_biased_index_inclusive_end (idx_t biased_index) const PRODUCT_RETURN;
94
92
95
93
public:
96
94
virtual ~G1BiasedMappedArrayBase ();
@@ -103,10 +101,15 @@ class G1BiasedMappedArrayBase : public CHeapObj<mtGC> {
103
101
// heap into this array.
104
102
template <class T >
105
103
class G1BiasedMappedArray : public G1BiasedMappedArrayBase {
104
+
105
+ T* base () const { return (T*)G1BiasedMappedArrayBase::_base; }
106
+
107
+ // The raw biased base pointer.
108
+ T* biased_base () const { return (T*)G1BiasedMappedArrayBase::_biased_base; }
109
+
106
110
public:
107
111
typedef G1BiasedMappedArrayBase::idx_t idx_t ;
108
112
109
- T* base () const { return (T*)G1BiasedMappedArrayBase::_base; }
110
113
// Return the element of the given array at the given index. Assume
111
114
// the index is valid. This is a convenience method that does sanity
112
115
// checking on the index.
@@ -123,9 +126,6 @@ class G1BiasedMappedArray : public G1BiasedMappedArrayBase {
123
126
this ->base ()[index] = value;
124
127
}
125
128
126
- // The raw biased base pointer.
127
- T* biased_base () const { return (T*)G1BiasedMappedArrayBase::_biased_base; }
128
-
129
129
// Return the element of the given array that covers the given word in the
130
130
// heap. Assumes the index is valid.
131
131
T get_by_address (HeapWord* value) const {
@@ -166,15 +166,6 @@ class G1BiasedMappedArray : public G1BiasedMappedArrayBase {
166
166
}
167
167
}
168
168
169
- protected:
170
- // Returns the address of the element the given address maps to
171
- T* address_mapped_to (HeapWord* address) {
172
- idx_t biased_index = ((uintptr_t )address) >> this ->shift_by ();
173
- this ->verify_biased_index_inclusive_end (biased_index);
174
- return biased_base () + biased_index;
175
- }
176
-
177
- public:
178
169
// Return the smallest address (inclusive) in the heap that this array covers.
179
170
HeapWord* bottom_address_mapped () const {
180
171
return (HeapWord*) ((uintptr_t )this ->bias () << this ->shift_by ());
@@ -194,6 +185,7 @@ class G1BiasedMappedArray : public G1BiasedMappedArrayBase {
194
185
set_by_index (i, value);
195
186
}
196
187
}
188
+
197
189
public:
198
190
G1BiasedMappedArray () {}
199
191
0 commit comments