< prev index next >

src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp

Print this page
rev 7793 : 8073315: Enable gcc -Wtype-limits and fix upcoming issues.


 225         byte_for(first_block + sp->block_size(first_block) - 1);
 226     jbyte* first_card_of_cur_chunk = byte_for(chunk_mr.start());
 227     jbyte* last_card_of_cur_chunk = byte_for(chunk_mr.last());
 228     jbyte* last_card_to_check =
 229       (jbyte*) MIN2((intptr_t) last_card_of_cur_chunk,
 230                     (intptr_t) last_card_of_first_obj);
 231     // Note that this does not need to go beyond our last card
 232     // if our first object completely straddles this chunk.
 233     for (jbyte* cur = first_card_of_cur_chunk;
 234          cur <= last_card_to_check; cur++) {
 235       jbyte val = *cur;
 236       if (card_will_be_scanned(val)) {
 237         first_dirty_card = cur; break;
 238       } else {
 239         assert(!card_may_have_been_dirty(val), "Error");
 240       }
 241     }
 242     if (first_dirty_card != NULL) {
 243       NOISY(tty->print_cr(" LNC: Found a dirty card at " PTR_FORMAT " in current chunk",
 244                     first_dirty_card);)
 245       assert(0 <= cur_chunk_index && cur_chunk_index < lowest_non_clean_chunk_size,
 246              "Bounds error.");
 247       assert(lowest_non_clean[cur_chunk_index] == NULL,
 248              "Write exactly once : value should be stable hereafter for this round");
 249       lowest_non_clean[cur_chunk_index] = first_dirty_card;
 250     } NOISY(else {
 251       tty->print_cr(" LNC: Found no dirty card in current chunk; leaving LNC entry NULL");
 252       // In the future, we could have this thread look for a non-NULL value to copy from its
 253       // right neighbor (up to the end of the first object).
 254       if (last_card_of_cur_chunk < last_card_of_first_obj) {
 255         tty->print_cr(" LNC: BEWARE!!! first obj straddles past right end of chunk:\n"
 256                       "   might be efficient to get value from right neighbor?");
 257       }
 258     })
 259   } else {
 260     // In this case we can help our neighbor by just asking them
 261     // to stop at our first card (even though it may not be dirty).
 262     NOISY(tty->print_cr(" LNC: first block is not a non-array object; setting LNC to first card of current chunk");)
 263     assert(lowest_non_clean[cur_chunk_index] == NULL, "Write once : value should be stable hereafter");
 264     jbyte* first_card_of_cur_chunk = byte_for(chunk_mr.start());
 265     lowest_non_clean[cur_chunk_index] = first_card_of_cur_chunk;




 225         byte_for(first_block + sp->block_size(first_block) - 1);
 226     jbyte* first_card_of_cur_chunk = byte_for(chunk_mr.start());
 227     jbyte* last_card_of_cur_chunk = byte_for(chunk_mr.last());
 228     jbyte* last_card_to_check =
 229       (jbyte*) MIN2((intptr_t) last_card_of_cur_chunk,
 230                     (intptr_t) last_card_of_first_obj);
 231     // Note that this does not need to go beyond our last card
 232     // if our first object completely straddles this chunk.
 233     for (jbyte* cur = first_card_of_cur_chunk;
 234          cur <= last_card_to_check; cur++) {
 235       jbyte val = *cur;
 236       if (card_will_be_scanned(val)) {
 237         first_dirty_card = cur; break;
 238       } else {
 239         assert(!card_may_have_been_dirty(val), "Error");
 240       }
 241     }
 242     if (first_dirty_card != NULL) {
 243       NOISY(tty->print_cr(" LNC: Found a dirty card at " PTR_FORMAT " in current chunk",
 244                     first_dirty_card);)
 245       assert(cur_chunk_index < lowest_non_clean_chunk_size,
 246              "Bounds error.");
 247       assert(lowest_non_clean[cur_chunk_index] == NULL,
 248              "Write exactly once : value should be stable hereafter for this round");
 249       lowest_non_clean[cur_chunk_index] = first_dirty_card;
 250     } NOISY(else {
 251       tty->print_cr(" LNC: Found no dirty card in current chunk; leaving LNC entry NULL");
 252       // In the future, we could have this thread look for a non-NULL value to copy from its
 253       // right neighbor (up to the end of the first object).
 254       if (last_card_of_cur_chunk < last_card_of_first_obj) {
 255         tty->print_cr(" LNC: BEWARE!!! first obj straddles past right end of chunk:\n"
 256                       "   might be efficient to get value from right neighbor?");
 257       }
 258     })
 259   } else {
 260     // In this case we can help our neighbor by just asking them
 261     // to stop at our first card (even though it may not be dirty).
 262     NOISY(tty->print_cr(" LNC: first block is not a non-array object; setting LNC to first card of current chunk");)
 263     assert(lowest_non_clean[cur_chunk_index] == NULL, "Write once : value should be stable hereafter");
 264     jbyte* first_card_of_cur_chunk = byte_for(chunk_mr.start());
 265     lowest_non_clean[cur_chunk_index] = first_card_of_cur_chunk;


< prev index next >