comparison src/share/vm/memory/cardTableModRefBS.cpp @ 1091:6aa7255741f3

6906727: UseCompressedOops: some card-marking fixes related to object arrays Summary: Introduced a new write_ref_array(HeapWords* start, size_t count) method that does the requisite MemRegion range calculation so (some of the) clients of the erstwhile write_ref_array(MemRegion mr) do not need to worry. This removed all external uses of array_size(), which was also simplified and made private. Asserts were added to catch other possible issues. Further, less essential, fixes stemming from this investigation are deferred to CR 6904516 (to follow shortly in hs17). Reviewed-by: kvn, coleenp, jmasa
author ysr
date Thu, 03 Dec 2009 15:01:57 -0800
parents 8624da129f0b
children c18cbe5936b8
comparison
equal deleted inserted replaced
1090:fa357420e7d2 1091:6aa7255741f3
509 } 509 }
510 non_clean_card_iterate(sp, used_mr, dcto_cl, dcto_cl, clear); 510 non_clean_card_iterate(sp, used_mr, dcto_cl, dcto_cl, clear);
511 } 511 }
512 512
513 void CardTableModRefBS::dirty_MemRegion(MemRegion mr) { 513 void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
514 assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
515 assert((HeapWord*)align_size_up ((uintptr_t)mr.end(), HeapWordSize) == mr.end(), "Unaligned end" );
514 jbyte* cur = byte_for(mr.start()); 516 jbyte* cur = byte_for(mr.start());
515 jbyte* last = byte_after(mr.last()); 517 jbyte* last = byte_after(mr.last());
516 while (cur < last) { 518 while (cur < last) {
517 *cur = dirty_card; 519 *cur = dirty_card;
518 cur++; 520 cur++;
519 } 521 }
520 } 522 }
521 523
522 void CardTableModRefBS::invalidate(MemRegion mr, bool whole_heap) { 524 void CardTableModRefBS::invalidate(MemRegion mr, bool whole_heap) {
525 assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
526 assert((HeapWord*)align_size_up ((uintptr_t)mr.end(), HeapWordSize) == mr.end(), "Unaligned end" );
523 for (int i = 0; i < _cur_covered_regions; i++) { 527 for (int i = 0; i < _cur_covered_regions; i++) {
524 MemRegion mri = mr.intersection(_covered[i]); 528 MemRegion mri = mr.intersection(_covered[i]);
525 if (!mri.is_empty()) dirty_MemRegion(mri); 529 if (!mri.is_empty()) dirty_MemRegion(mri);
526 } 530 }
527 } 531 }