1
1
/*
2
- * Copyright (c) 2001, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2001, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -49,9 +49,9 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st
49
49
50
50
#ifdef ASSERT
51
51
void G1BlockOffsetTable::check_index (size_t index, const char * msg) const {
52
- assert ((index ) < (_reserved.word_size () >> BOTConstants::log_card_size_in_words ()),
52
+ assert ((index ) < (_reserved.word_size () >> CardTable::card_shift_in_words ()),
53
53
" %s - index: " SIZE_FORMAT " , _vs.committed_size: " SIZE_FORMAT,
54
- msg, (index ), (_reserved.word_size () >> BOTConstants::log_card_size_in_words ()));
54
+ msg, (index ), (_reserved.word_size () >> CardTable::card_shift_in_words ()));
55
55
assert (G1CollectedHeap::heap ()->is_in (address_for_index_raw (index )),
56
56
" Index " SIZE_FORMAT " corresponding to " PTR_FORMAT
57
57
" (%u) is not in committed area." ,
@@ -107,7 +107,7 @@ G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, HeapRe
107
107
void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl (size_t start_card, size_t end_card) {
108
108
assert (start_card <= end_card, " precondition" );
109
109
assert (start_card > _bot->index_for (_hr->bottom ()), " Cannot be first card" );
110
- assert (_bot->offset_array (start_card-1 ) < BOTConstants ::card_size_in_words (),
110
+ assert (_bot->offset_array (start_card-1 ) < CardTable ::card_size_in_words (),
111
111
" Offset card has an unexpected value" );
112
112
size_t start_card_for_region = start_card;
113
113
u_char offset = max_jubyte;
@@ -116,7 +116,7 @@ void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_c
116
116
// so that the reach ends in this region and not at the start
117
117
// of the next.
118
118
size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back (i+1 ) - 1 );
119
- offset = BOTConstants ::card_size_in_words () + i;
119
+ offset = CardTable ::card_size_in_words () + i;
120
120
if (reach >= end_card) {
121
121
_bot->set_offset_array (start_card_for_region, end_card, offset);
122
122
start_card_for_region = reach + 1 ;
@@ -138,16 +138,16 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card)
138
138
if (end_card < start_card) {
139
139
return ;
140
140
}
141
- guarantee (_bot->offset_array (start_card) == BOTConstants ::card_size_in_words (), " Wrong value in second card" );
141
+ guarantee (_bot->offset_array (start_card) == CardTable ::card_size_in_words (), " Wrong value in second card" );
142
142
for (size_t c = start_card + 1 ; c <= end_card; c++ /* yeah! */ ) {
143
143
u_char entry = _bot->offset_array (c);
144
144
if (c - start_card > BOTConstants::power_to_cards_back (1 )) {
145
- guarantee (entry > BOTConstants ::card_size_in_words (),
145
+ guarantee (entry > CardTable ::card_size_in_words (),
146
146
" Should be in logarithmic region - "
147
147
" entry: %u, "
148
148
" _array->offset_array(c): %u, "
149
149
" N_words: %u" ,
150
- (uint )entry, (uint )_bot->offset_array (c), BOTConstants ::card_size_in_words ());
150
+ (uint )entry, (uint )_bot->offset_array (c), CardTable ::card_size_in_words ());
151
151
}
152
152
size_t backskip = BOTConstants::entry_to_cards_back (entry);
153
153
size_t landing_card = c - backskip;
@@ -160,10 +160,10 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card)
160
160
} else {
161
161
guarantee (landing_card == start_card - 1 , " Tautology" );
162
162
// Note that N_words is the maximum offset value
163
- guarantee (_bot->offset_array (landing_card) < BOTConstants ::card_size_in_words (),
163
+ guarantee (_bot->offset_array (landing_card) < CardTable ::card_size_in_words (),
164
164
" landing card offset: %u, "
165
165
" N_words: %u" ,
166
- (uint )_bot->offset_array (landing_card), (uint )BOTConstants ::card_size_in_words ());
166
+ (uint )_bot->offset_array (landing_card), (uint )CardTable ::card_size_in_words ());
167
167
}
168
168
}
169
169
}
@@ -188,13 +188,13 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
188
188
" phantom block" );
189
189
assert (blk_end > cur_card_boundary, " should be past cur_card_boundary" );
190
190
assert (blk_start <= cur_card_boundary, " blk_start should be at or before cur_card_boundary" );
191
- assert (pointer_delta (cur_card_boundary, blk_start) < BOTConstants ::card_size_in_words (),
192
- " offset should be < BOTConstants ::card_size_in_words()" );
191
+ assert (pointer_delta (cur_card_boundary, blk_start) < CardTable ::card_size_in_words (),
192
+ " offset should be < CardTable ::card_size_in_words()" );
193
193
assert (G1CollectedHeap::heap ()->is_in_reserved (blk_start),
194
194
" reference must be into the heap" );
195
195
assert (G1CollectedHeap::heap ()->is_in_reserved (blk_end - 1 ),
196
196
" limit must be within the heap" );
197
- assert (cur_card_boundary == _bot->_reserved .start () + index * BOTConstants ::card_size_in_words (),
197
+ assert (cur_card_boundary == _bot->_reserved .start () + index * CardTable ::card_size_in_words (),
198
198
" index must agree with cur_card_boundary" );
199
199
200
200
// Mark the card that holds the offset into the block.
@@ -213,15 +213,15 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
213
213
#ifdef ASSERT
214
214
// Calculate new_card_boundary this way because end_index
215
215
// may be the last valid index in the covered region.
216
- HeapWord* new_card_boundary = _bot->address_for_index (end_index) + BOTConstants ::card_size_in_words ();
216
+ HeapWord* new_card_boundary = _bot->address_for_index (end_index) + CardTable ::card_size_in_words ();
217
217
assert (new_card_boundary >= blk_end, " postcondition" );
218
218
219
219
// The offset can be 0 if the block starts on a boundary. That
220
220
// is checked by an assertion above.
221
221
size_t start_index = _bot->index_for (blk_start);
222
222
HeapWord* boundary = _bot->address_for_index (start_index);
223
223
assert ((_bot->offset_array (index ) == 0 && blk_start == boundary) ||
224
- (_bot->offset_array (index ) > 0 && _bot->offset_array (index ) < BOTConstants ::card_size_in_words ()),
224
+ (_bot->offset_array (index ) > 0 && _bot->offset_array (index ) < CardTable ::card_size_in_words ()),
225
225
" offset array should have been set - "
226
226
" index offset: %u, "
227
227
" blk_start: " PTR_FORMAT " , "
@@ -231,12 +231,12 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
231
231
for (size_t j = index + 1 ; j <= end_index; j++) {
232
232
assert (_bot->offset_array (j) > 0 &&
233
233
_bot->offset_array (j) <=
234
- (u_char ) (BOTConstants ::card_size_in_words ()+ BOTConstants::N_powers- 1 ),
234
+ (u_char ) (CardTable ::card_size_in_words () + BOTConstants::N_powers - 1 ),
235
235
" offset array should have been set - "
236
236
" %u not > 0 OR %u not <= %u" ,
237
237
(uint ) _bot->offset_array (j),
238
238
(uint ) _bot->offset_array (j),
239
- (uint ) (BOTConstants ::card_size_in_words () + BOTConstants::N_powers - 1 ));
239
+ (uint ) (CardTable ::card_size_in_words () + BOTConstants::N_powers - 1 ));
240
240
}
241
241
#endif
242
242
}
@@ -248,7 +248,7 @@ void G1BlockOffsetTablePart::verify() const {
248
248
249
249
for (size_t current_card = start_card; current_card < end_card; current_card++) {
250
250
u_char entry = _bot->offset_array (current_card);
251
- if (entry < BOTConstants ::card_size_in_words ()) {
251
+ if (entry < CardTable ::card_size_in_words ()) {
252
252
// The entry should point to an object before the current card. Verify that
253
253
// it is possible to walk from that object in to the current card by just
254
254
// iterating over the objects following it.
0 commit comments