@@ -40,17 +40,17 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st
4040
4141 MemRegion bot_reserved = storage->reserved ();
4242
43- _offset_base = ((u_char *)bot_reserved.start () - (uintptr_t (_reserved.start ()) >> CardTable::card_shift ()));
43+ _offset_base = ((uint8_t *)bot_reserved.start () - (uintptr_t (_reserved.start ()) >> CardTable::card_shift ()));
4444
4545 log_trace (gc, bot)(" G1BlockOffsetTable::G1BlockOffsetTable: " );
4646 log_trace (gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT,
4747 p2i (bot_reserved.start ()), bot_reserved.byte_size (), p2i (bot_reserved.end ()));
4848}
4949
5050#ifdef ASSERT
51- void G1BlockOffsetTable::check_address (u_char * addr, const char * msg) const {
52- u_char * start_addr = const_cast <u_char *>(_offset_base + (uintptr_t (_reserved.start ()) >> CardTable::card_shift ()));
53- u_char * end_addr = const_cast <u_char *>(_offset_base + (uintptr_t (_reserved.end ()) >> CardTable::card_shift ()));
51+ void G1BlockOffsetTable::check_address (uint8_t * addr, const char * msg) const {
52+ uint8_t * start_addr = const_cast <uint8_t *>(_offset_base + (uintptr_t (_reserved.start ()) >> CardTable::card_shift ()));
53+ uint8_t * end_addr = const_cast <uint8_t *>(_offset_base + (uintptr_t (_reserved.end ()) >> CardTable::card_shift ()));
5454 assert (addr >= start_addr && addr <= end_addr,
5555 " %s - offset address: " PTR_FORMAT " , start address: " PTR_FORMAT " , end address: " PTR_FORMAT,
5656 msg, (p2i (addr)), (p2i (start_addr)), (p2i (end_addr)));
@@ -102,18 +102,18 @@ G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, HeapRe
102102// Move back N (e.g., 8) entries and repeat with the
103103// value of the new entry
104104//
105- void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl (u_char * start_card, u_char * end_card) {
105+ void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl (uint8_t * start_card, uint8_t * end_card) {
106106 assert (start_card <= end_card, " precondition" );
107107 assert (start_card > _bot->entry_for_addr (_hr->bottom ()), " Cannot be first card" );
108108 assert (_bot->offset_array (start_card-1 ) < CardTable::card_size_in_words (),
109109 " Offset card has an unexpected value" );
110- u_char * start_card_for_region = start_card;
111- u_char offset = max_jubyte ;
110+ uint8_t * start_card_for_region = start_card;
111+ uint8_t offset = UINT8_MAX ;
112112 for (uint i = 0 ; i < BOTConstants::N_powers; i++) {
113113 // -1 so that the card with the actual offset is counted. Another -1
114114 // so that the reach ends in this region and not at the start
115115 // of the next.
116- u_char * reach = start_card - 1 + (BOTConstants::power_to_cards_back (i+1 ) - 1 );
116+ uint8_t * reach = start_card - 1 + (BOTConstants::power_to_cards_back (i+1 ) - 1 );
117117 offset = CardTable::card_size_in_words () + i;
118118 if (reach >= end_card) {
119119 _bot->set_offset_array (start_card_for_region, end_card, offset);
@@ -131,13 +131,13 @@ void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(u_char* start_
131131// The card-interval [start_card, end_card] is a closed interval; this
132132// is an expensive check -- use with care and only under protection of
133133// suitable flag.
134- void G1BlockOffsetTablePart::check_all_cards (u_char * start_card, u_char * end_card) const {
134+ void G1BlockOffsetTablePart::check_all_cards (uint8_t * start_card, uint8_t * end_card) const {
135135 if (end_card < start_card) {
136136 return ;
137137 }
138138 guarantee (_bot->offset_array (start_card) == CardTable::card_size_in_words (), " Wrong value in second card" );
139- for (u_char * c = start_card + 1 ; c <= end_card; c++ /* yeah! */ ) {
140- u_char entry = _bot->offset_array (c);
139+ for (uint8_t * c = start_card + 1 ; c <= end_card; c++ /* yeah! */ ) {
140+ uint8_t entry = _bot->offset_array (c);
141141 if ((unsigned )(c - start_card) > BOTConstants::power_to_cards_back (1 )) {
142142 guarantee (entry > CardTable::card_size_in_words (),
143143 " Should be in logarithmic region - "
@@ -147,7 +147,7 @@ void G1BlockOffsetTablePart::check_all_cards(u_char* start_card, u_char* end_car
147147 (uint)entry, (uint)_bot->offset_array (c), CardTable::card_size_in_words ());
148148 }
149149 size_t backskip = BOTConstants::entry_to_cards_back (entry);
150- u_char * landing_card = c - backskip;
150+ uint8_t * landing_card = c - backskip;
151151 guarantee (landing_card >= (start_card - 1 ), " Inv" );
152152 if (landing_card >= start_card) {
153153 guarantee (_bot->offset_array (landing_card) <= entry,
@@ -179,7 +179,7 @@ void G1BlockOffsetTablePart::check_all_cards(u_char* start_card, u_char* end_car
179179void G1BlockOffsetTablePart::update_for_block_work (HeapWord* blk_start,
180180 HeapWord* blk_end) {
181181 HeapWord* const cur_card_boundary = align_up_by_card_size (blk_start);
182- u_char * const offset_card = _bot->entry_for_addr (cur_card_boundary);
182+ uint8_t * const offset_card = _bot->entry_for_addr (cur_card_boundary);
183183
184184 assert (blk_start != nullptr && blk_end > blk_start,
185185 " phantom block" );
@@ -200,7 +200,7 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
200200 // We need to now mark the subsequent cards that this block spans.
201201
202202 // Index of card on which the block ends.
203- u_char * end_card = _bot->entry_for_addr (blk_end - 1 );
203+ uint8_t * end_card = _bot->entry_for_addr (blk_end - 1 );
204204
205205 // Are there more cards left to be updated?
206206 if (offset_card + 1 <= end_card) {
@@ -215,7 +215,7 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
215215
216216 // The offset can be 0 if the block starts on a boundary. That
217217 // is checked by an assertion above.
218- u_char * previous_card = _bot->entry_for_addr (blk_start);
218+ uint8_t * previous_card = _bot->entry_for_addr (blk_start);
219219 HeapWord* boundary = _bot->addr_for_entry (previous_card);
220220 assert ((_bot->offset_array (offset_card) == 0 && blk_start == boundary) ||
221221 (_bot->offset_array (offset_card) > 0 && _bot->offset_array (offset_card) < CardTable::card_size_in_words ()),
@@ -225,10 +225,10 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
225225 " boundary: " PTR_FORMAT,
226226 (uint)_bot->offset_array (offset_card),
227227 p2i (blk_start), p2i (boundary));
228- for (u_char * j = offset_card + 1 ; j <= end_card; j++) {
228+ for (uint8_t * j = offset_card + 1 ; j <= end_card; j++) {
229229 assert (_bot->offset_array (j) > 0 &&
230230 _bot->offset_array (j) <=
231- (u_char ) (CardTable::card_size_in_words () + BOTConstants::N_powers - 1 ),
231+ (uint8_t ) (CardTable::card_size_in_words () + BOTConstants::N_powers - 1 ),
232232 " offset array should have been set - "
233233 " %u not > 0 OR %u not <= %u" ,
234234 (uint) _bot->offset_array (j),
@@ -240,11 +240,11 @@ void G1BlockOffsetTablePart::update_for_block_work(HeapWord* blk_start,
240240
241241void G1BlockOffsetTablePart::verify () const {
242242 assert (_hr->bottom () < _hr->top (), " Only non-empty regions should be verified." );
243- u_char * start_card = _bot->entry_for_addr (_hr->bottom ());
244- u_char * end_card = _bot->entry_for_addr (_hr->top () - 1 );
243+ uint8_t * start_card = _bot->entry_for_addr (_hr->bottom ());
244+ uint8_t * end_card = _bot->entry_for_addr (_hr->top () - 1 );
245245
246- for (u_char * current_card = start_card; current_card < end_card; current_card++) {
247- u_char entry = _bot->offset_array (current_card);
246+ for (uint8_t * current_card = start_card; current_card < end_card; current_card++) {
247+ uint8_t entry = _bot->offset_array (current_card);
248248 if (entry < CardTable::card_size_in_words ()) {
249249 // The entry should point to an object before the current card. Verify that
250250 // it is possible to walk from that object in to the current card by just
@@ -281,12 +281,12 @@ void G1BlockOffsetTablePart::verify() const {
281281
282282#ifndef PRODUCT
283283void G1BlockOffsetTablePart::print_on (outputStream* out) {
284- u_char * from_card = _bot->entry_for_addr (_hr->bottom ());
285- u_char * to_card = _bot->entry_for_addr (_hr->end ());
284+ uint8_t * from_card = _bot->entry_for_addr (_hr->bottom ());
285+ uint8_t * to_card = _bot->entry_for_addr (_hr->end ());
286286 out->print_cr (" >> BOT for area [" PTR_FORMAT " ," PTR_FORMAT " ) "
287287 " cards [" SIZE_FORMAT " ," SIZE_FORMAT " )" ,
288288 p2i (_hr->bottom ()), p2i (_hr->end ()), p2i (from_card), p2i (to_card));
289- for (u_char * i = from_card; i < to_card; ++i) {
289+ for (uint8_t * i = from_card; i < to_card; ++i) {
290290 out->print_cr (" entry " SIZE_FORMAT_W (8 ) " | " PTR_FORMAT " : %3u" ,
291291 p2i (i), p2i (_bot->addr_for_entry (i)),
292292 (uint) _bot->offset_array (i));
0 commit comments