src/share/vm/gc_implementation/g1/g1CardCounts.cpp

changeset 5121
bed55d125e37
parent 5078
194f52aa2f23
child 5342
5ea20b3bd249
     1.1 --- a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Wed May 15 10:41:22 2013 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Wed May 15 22:35:36 2013 -0700
     1.3 @@ -101,20 +101,23 @@
     1.4           ReservedSpace::allocation_align_size_up(_committed_size),
     1.5           err_msg("Unaligned? committed_size: " SIZE_FORMAT, _committed_size));
     1.6  
     1.7 -  // Verify that the committed space for the card counts
     1.8 -  // matches our committed max card num.
     1.9 +  // Verify that the committed space for the card counts matches our
    1.10 +  // committed max card num. Note for some allocation alignments, the
    1.11 +  // amount of space actually committed for the counts table will be able
    1.12 +  // to span more cards than the number spanned by the maximum heap.
    1.13    size_t prev_committed_size = _committed_size;
    1.14 -  size_t prev_committed_card_num = prev_committed_size / sizeof(jbyte);
    1.15 +  size_t prev_committed_card_num = committed_to_card_num(prev_committed_size);
    1.16 +
    1.17    assert(prev_committed_card_num == _committed_max_card_num,
    1.18           err_msg("Card mismatch: "
    1.19                   "prev: " SIZE_FORMAT ", "
    1.20 -                 "committed: "SIZE_FORMAT,
    1.21 -                 prev_committed_card_num, _committed_max_card_num));
    1.22 +                 "committed: "SIZE_FORMAT", "
    1.23 +                 "reserved: "SIZE_FORMAT,
    1.24 +                 prev_committed_card_num, _committed_max_card_num, _reserved_max_card_num));
    1.25  
    1.26    size_t new_size = (heap_capacity >> CardTableModRefBS::card_shift) * sizeof(jbyte);
    1.27    size_t new_committed_size = ReservedSpace::allocation_align_size_up(new_size);
    1.28 -  size_t new_committed_card_num =
    1.29 -                MIN2(_reserved_max_card_num, new_committed_size / sizeof(jbyte));
    1.30 +  size_t new_committed_card_num = committed_to_card_num(new_committed_size);
    1.31  
    1.32    if (_committed_max_card_num < new_committed_card_num) {
    1.33      // we need to expand the backing store for the card counts

mercurial