|
111 | 111 | // --------
|
112 | 112 | // hash:24 ------------>| larval:1 age:4 inline_type:1 lock:2
|
113 | 113 | //
|
114 |
| -// 64 bits: |
| 114 | +// 64 bits (follows ocmpact object header): |
115 | 115 | // --------
|
116 |
| -// unused:1 | <-- hash:31 -->| unused:22 larval:1 age:4 flat_array:1 null_free_array:1 inline_type:1 lock:2 |
117 |
| -// klass:22 hash:31 -->| larval:1 age:4 flat_array:1 null_free_array:1 inline_type:1 self-fwd:1 lock:2 (normal object) |
| 116 | +// klass:22 hash:31 -->| larval:1 flat_array:1 null_free_array:1 inline_type:1 age:4 self-fwd:1 lock:2 (normal object) |
118 | 117 | //
|
119 | 118 | // The "fast" static type bits (flat_array, null_free_array, and inline_type)
|
120 | 119 | // are placed lowest next to lock bits to more easily decode forwarding pointers.
|
@@ -183,44 +182,43 @@ class markWord {
|
183 | 182 | // Constants, in least significant bit order
|
184 | 183 | static const int lock_bits = 2;
|
185 | 184 | static const int self_fwd_bits = 1;
|
| 185 | + // instance state |
| 186 | + static const int age_bits = 4; |
186 | 187 | // EnableValhalla: static prototype header bits (fast path instead of klass layout_helper)
|
187 | 188 | static const int inline_type_bits = 1;
|
188 | 189 | static const int null_free_array_bits = LP64_ONLY(1) NOT_LP64(0);
|
189 | 190 | static const int flat_array_bits = LP64_ONLY(1) NOT_LP64(0);
|
190 |
| - // instance state |
191 |
| - static const int age_bits = 4; |
192 | 191 | static const int larval_bits = 1;
|
193 | 192 | static const int max_hash_bits = BitsPerWord - age_bits - lock_bits - inline_type_bits - larval_bits - flat_array_bits - null_free_array_bits - self_fwd_bits;
|
194 | 193 | static const int hash_bits = max_hash_bits > 31 ? 31 : max_hash_bits;
|
195 | 194 |
|
196 | 195 | static const int lock_shift = 0;
|
197 |
| - static const int self_fwd_shift = lock_bits ; |
198 |
| - static const int inline_type_shift = self_fwd_shift + self_fwd_bits; |
| 196 | + static const int self_fwd_shift = lock_shift + lock_bits; |
| 197 | + static const int age_shift = self_fwd_shift + self_fwd_bits; |
| 198 | + static const int inline_type_shift = age_shift + age_bits; |
199 | 199 | static const int null_free_array_shift = inline_type_shift + inline_type_bits;
|
200 | 200 | static const int flat_array_shift = null_free_array_shift + null_free_array_bits;
|
201 |
| - static const int age_shift = flat_array_shift + flat_array_bits; |
202 |
| - static const int larval_shift = age_shift + age_bits; |
| 201 | + static const int larval_shift = flat_array_shift + flat_array_bits; |
203 | 202 | static const int hash_shift = larval_shift + larval_bits;
|
204 | 203 |
|
205 | 204 | static const uintptr_t lock_mask = right_n_bits(lock_bits);
|
206 | 205 | static const uintptr_t lock_mask_in_place = lock_mask << lock_shift;
|
207 | 206 | static const uintptr_t self_fwd_mask = right_n_bits(self_fwd_bits);
|
208 | 207 | static const uintptr_t self_fwd_mask_in_place = self_fwd_mask << self_fwd_shift;
|
209 |
| - static const uintptr_t inline_type_bit_in_place = 1 << inline_type_shift; |
210 |
| - static const uintptr_t inline_type_mask = inline_type_bit_in_place + lock_mask; |
211 |
| - static const uintptr_t inline_type_mask_in_place = inline_type_mask << lock_shift; |
| 208 | + static const uintptr_t inline_type_bit_in_place = right_n_bits(inline_type_bits) << inline_type_shift; |
| 209 | + static const uintptr_t inline_type_mask_in_place = inline_type_bit_in_place + lock_mask; |
212 | 210 | static const uintptr_t null_free_array_mask = right_n_bits(null_free_array_bits);
|
213 | 211 | static const uintptr_t null_free_array_mask_in_place = (null_free_array_mask << null_free_array_shift) | lock_mask_in_place;
|
214 |
| - static const uintptr_t null_free_array_bit_in_place = (1 << null_free_array_shift); |
| 212 | + static const uintptr_t null_free_array_bit_in_place = (right_n_bits(null_free_array_bits) << null_free_array_shift); |
215 | 213 | static const uintptr_t flat_array_mask = right_n_bits(flat_array_bits);
|
216 | 214 | static const uintptr_t flat_array_mask_in_place = (flat_array_mask << flat_array_shift) | null_free_array_mask_in_place | lock_mask_in_place;
|
217 |
| - static const uintptr_t flat_array_bit_in_place = (1 << flat_array_shift); |
| 215 | + static const uintptr_t flat_array_bit_in_place = right_n_bits(flat_array_bits) << flat_array_shift; |
218 | 216 | static const uintptr_t age_mask = right_n_bits(age_bits);
|
219 | 217 | static const uintptr_t age_mask_in_place = age_mask << age_shift;
|
220 | 218 |
|
221 | 219 | static const uintptr_t larval_mask = right_n_bits(larval_bits);
|
222 | 220 | static const uintptr_t larval_mask_in_place = (larval_mask << larval_shift) | inline_type_mask_in_place;
|
223 |
| - static const uintptr_t larval_bit_in_place = (1 << larval_shift); |
| 221 | + static const uintptr_t larval_bit_in_place = right_n_bits(larval_bits) << larval_shift; |
224 | 222 |
|
225 | 223 | static const uintptr_t hash_mask = right_n_bits(hash_bits);
|
226 | 224 | static const uintptr_t hash_mask_in_place = hash_mask << hash_shift;
|
|
0 commit comments