< prev index next >

src/share/vm/memory/cardTableModRefBS.cpp

Print this page
rev 7400 : 8059066: CardTableModRefBS might commit the same page twice (01)


 259     // Commit new or uncommit old pages, if necessary.
 260     MemRegion cur_committed = _committed[ind];
 261     // Extend the end of this _committed region
 262     // to cover the end of any lower _committed regions.
 263     // This forms overlapping regions, but never interior regions.
 264     HeapWord* const max_prev_end = largest_prev_committed_end(ind);
 265     if (max_prev_end > cur_committed.end()) {
 266       cur_committed.set_end(max_prev_end);
 267     }
 268     // Align the end up to a page size (starts are already aligned).
 269     jbyte* const new_end = byte_after(new_region.last());
 270     HeapWord* new_end_aligned =
 271       (HeapWord*) align_size_up((uintptr_t)new_end, _page_size);
 272     assert(new_end_aligned >= (HeapWord*) new_end,
 273            "align up, but less");
 274     // Check the other regions (excludes "ind") to ensure that
 275     // the new_end_aligned does not intrude onto the committed
 276     // space of another region.
 277     int ri = 0;
 278     for (ri = ind + 1; ri < _cur_covered_regions; ri++) {
 279       if (new_end_aligned > _committed[ri].start() &&
 280           new_end_aligned <= _committed[ri].end()) {

 281         // Any region containing the new end
 282         // should start at or beyond the region found (ind)
 283         // for the new end (committed regions are not expected to
 284         // be proper subsets of other committed regions).
 285         assert(_committed[ri].start() >= _committed[ind].start(),
 286                "New end of committed region is inconsistent");
 287         new_end_aligned = _committed[ri].start();
 288         // new_end_aligned can be equal to the start of its
 289         // committed region (i.e., of "ind") if a second
 290         // region following "ind" also start at the same location
 291         // as "ind".
 292         assert(new_end_aligned >= _committed[ind].start(),
 293           "New end of committed region is before start");
 294         debug_only(collided = true;)
 295         // Should only collide with 1 region
 296         break;
 297       }
 298     }
 299 #ifdef ASSERT
 300     for (++ri; ri < _cur_covered_regions; ri++) {




 259     // Commit new or uncommit old pages, if necessary.
 260     MemRegion cur_committed = _committed[ind];
 261     // Extend the end of this _committed region
 262     // to cover the end of any lower _committed regions.
 263     // This forms overlapping regions, but never interior regions.
 264     HeapWord* const max_prev_end = largest_prev_committed_end(ind);
 265     if (max_prev_end > cur_committed.end()) {
 266       cur_committed.set_end(max_prev_end);
 267     }
 268     // Align the end up to a page size (starts are already aligned).
 269     jbyte* const new_end = byte_after(new_region.last());
 270     HeapWord* new_end_aligned =
 271       (HeapWord*) align_size_up((uintptr_t)new_end, _page_size);
 272     assert(new_end_aligned >= (HeapWord*) new_end,
 273            "align up, but less");
 274     // Check the other regions (excludes "ind") to ensure that
 275     // the new_end_aligned does not intrude onto the committed
 276     // space of another region.
 277     int ri = 0;
 278     for (ri = ind + 1; ri < _cur_covered_regions; ri++) {
 279       if (new_end_aligned > _committed[ri].start()) {
 280         assert(new_end_aligned <= _committed[ri].end(),
 281                "An earlier committed region can't cover a later committed region");
 282         // Any region containing the new end
 283         // should start at or beyond the region found (ind)
 284         // for the new end (committed regions are not expected to
 285         // be proper subsets of other committed regions).
 286         assert(_committed[ri].start() >= _committed[ind].start(),
 287                "New end of committed region is inconsistent");
 288         new_end_aligned = _committed[ri].start();
 289         // new_end_aligned can be equal to the start of its
 290         // committed region (i.e., of "ind") if a second
 291         // region following "ind" also start at the same location
 292         // as "ind".
 293         assert(new_end_aligned >= _committed[ind].start(),
 294           "New end of committed region is before start");
 295         debug_only(collided = true;)
 296         // Should only collide with 1 region
 297         break;
 298       }
 299     }
 300 #ifdef ASSERT
 301     for (++ri; ri < _cur_covered_regions; ri++) {


< prev index next >