comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 20377:a8ea2f110d87

8054819: Rename HeapRegionSeq to HeapRegionManager Reviewed-by: jwilhelm, jmasa
author tschatzl
date Tue, 26 Aug 2014 09:36:53 +0200
parents 1f1d373cd044
children 9337d0e7ea4f
comparison
equal deleted inserted replaced
20359:4d3a43351904 20377:a8ea2f110d87
32 #include "gc_implementation/g1/g1ErgoVerbose.hpp" 32 #include "gc_implementation/g1/g1ErgoVerbose.hpp"
33 #include "gc_implementation/g1/g1Log.hpp" 33 #include "gc_implementation/g1/g1Log.hpp"
34 #include "gc_implementation/g1/g1OopClosures.inline.hpp" 34 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
35 #include "gc_implementation/g1/g1RemSet.hpp" 35 #include "gc_implementation/g1/g1RemSet.hpp"
36 #include "gc_implementation/g1/heapRegion.inline.hpp" 36 #include "gc_implementation/g1/heapRegion.inline.hpp"
37 #include "gc_implementation/g1/heapRegionManager.inline.hpp"
37 #include "gc_implementation/g1/heapRegionRemSet.hpp" 38 #include "gc_implementation/g1/heapRegionRemSet.hpp"
38 #include "gc_implementation/g1/heapRegionSeq.inline.hpp"
39 #include "gc_implementation/g1/heapRegionSet.inline.hpp" 39 #include "gc_implementation/g1/heapRegionSet.inline.hpp"
40 #include "gc_implementation/shared/vmGCOperations.hpp" 40 #include "gc_implementation/shared/vmGCOperations.hpp"
41 #include "gc_implementation/shared/gcTimer.hpp" 41 #include "gc_implementation/shared/gcTimer.hpp"
42 #include "gc_implementation/shared/gcTrace.hpp" 42 #include "gc_implementation/shared/gcTrace.hpp"
43 #include "gc_implementation/shared/gcTraceTime.hpp" 43 #include "gc_implementation/shared/gcTraceTime.hpp"
1406 // to 1 the bits on the region bitmap that correspond to its 1406 // to 1 the bits on the region bitmap that correspond to its
1407 // associated "continues humongous" regions. 1407 // associated "continues humongous" regions.
1408 void set_bit_for_region(HeapRegion* hr) { 1408 void set_bit_for_region(HeapRegion* hr) {
1409 assert(!hr->continuesHumongous(), "should have filtered those out"); 1409 assert(!hr->continuesHumongous(), "should have filtered those out");
1410 1410
1411 BitMap::idx_t index = (BitMap::idx_t) hr->hrs_index(); 1411 BitMap::idx_t index = (BitMap::idx_t) hr->hrm_index();
1412 if (!hr->startsHumongous()) { 1412 if (!hr->startsHumongous()) {
1413 // Normal (non-humongous) case: just set the bit. 1413 // Normal (non-humongous) case: just set the bit.
1414 _region_bm->par_at_put(index, true); 1414 _region_bm->par_at_put(index, true);
1415 } else { 1415 } else {
1416 // Starts humongous case: calculate how many regions are part of 1416 // Starts humongous case: calculate how many regions are part of
1594 // we have missed accounting some objects during the actual marking. 1594 // we have missed accounting some objects during the actual marking.
1595 if (exp_marked_bytes > act_marked_bytes) { 1595 if (exp_marked_bytes > act_marked_bytes) {
1596 if (_verbose) { 1596 if (_verbose) {
1597 gclog_or_tty->print_cr("Region %u: marked bytes mismatch: " 1597 gclog_or_tty->print_cr("Region %u: marked bytes mismatch: "
1598 "expected: " SIZE_FORMAT ", actual: " SIZE_FORMAT, 1598 "expected: " SIZE_FORMAT ", actual: " SIZE_FORMAT,
1599 hr->hrs_index(), exp_marked_bytes, act_marked_bytes); 1599 hr->hrm_index(), exp_marked_bytes, act_marked_bytes);
1600 } 1600 }
1601 failures += 1; 1601 failures += 1;
1602 } 1602 }
1603 1603
1604 // Verify the bit, for this region, in the actual and expected 1604 // Verify the bit, for this region, in the actual and expected
1605 // (which was just calculated) region bit maps. 1605 // (which was just calculated) region bit maps.
1606 // We're not OK if the bit in the calculated expected region 1606 // We're not OK if the bit in the calculated expected region
1607 // bitmap is set and the bit in the actual region bitmap is not. 1607 // bitmap is set and the bit in the actual region bitmap is not.
1608 BitMap::idx_t index = (BitMap::idx_t) hr->hrs_index(); 1608 BitMap::idx_t index = (BitMap::idx_t) hr->hrm_index();
1609 1609
1610 bool expected = _exp_region_bm->at(index); 1610 bool expected = _exp_region_bm->at(index);
1611 bool actual = _region_bm->at(index); 1611 bool actual = _region_bm->at(index);
1612 if (expected && !actual) { 1612 if (expected && !actual) {
1613 if (_verbose) { 1613 if (_verbose) {
1614 gclog_or_tty->print_cr("Region %u: region bitmap mismatch: " 1614 gclog_or_tty->print_cr("Region %u: region bitmap mismatch: "
1615 "expected: %s, actual: %s", 1615 "expected: %s, actual: %s",
1616 hr->hrs_index(), 1616 hr->hrm_index(),
1617 BOOL_TO_STR(expected), BOOL_TO_STR(actual)); 1617 BOOL_TO_STR(expected), BOOL_TO_STR(actual));
1618 } 1618 }
1619 failures += 1; 1619 failures += 1;
1620 } 1620 }
1621 1621
1632 1632
1633 if (expected && !actual) { 1633 if (expected && !actual) {
1634 if (_verbose) { 1634 if (_verbose) {
1635 gclog_or_tty->print_cr("Region %u: card bitmap mismatch at " SIZE_FORMAT ": " 1635 gclog_or_tty->print_cr("Region %u: card bitmap mismatch at " SIZE_FORMAT ": "
1636 "expected: %s, actual: %s", 1636 "expected: %s, actual: %s",
1637 hr->hrs_index(), i, 1637 hr->hrm_index(), i,
1638 BOOL_TO_STR(expected), BOOL_TO_STR(actual)); 1638 BOOL_TO_STR(expected), BOOL_TO_STR(actual));
1639 } 1639 }
1640 failures += 1; 1640 failures += 1;
1641 } 1641 }
1642 } 1642 }
3252 } 3252 }
3253 3253
3254 assert(limit_idx <= end_idx, "or else use atomics"); 3254 assert(limit_idx <= end_idx, "or else use atomics");
3255 3255
3256 // Aggregate the "stripe" in the count data associated with hr. 3256 // Aggregate the "stripe" in the count data associated with hr.
3257 uint hrs_index = hr->hrs_index(); 3257 uint hrm_index = hr->hrm_index();
3258 size_t marked_bytes = 0; 3258 size_t marked_bytes = 0;
3259 3259
3260 for (uint i = 0; i < _max_worker_id; i += 1) { 3260 for (uint i = 0; i < _max_worker_id; i += 1) {
3261 size_t* marked_bytes_array = _cm->count_marked_bytes_array_for(i); 3261 size_t* marked_bytes_array = _cm->count_marked_bytes_array_for(i);
3262 BitMap* task_card_bm = _cm->count_card_bitmap_for(i); 3262 BitMap* task_card_bm = _cm->count_card_bitmap_for(i);
3263 3263
3264 // Fetch the marked_bytes in this region for task i and 3264 // Fetch the marked_bytes in this region for task i and
3265 // add it to the running total for this region. 3265 // add it to the running total for this region.
3266 marked_bytes += marked_bytes_array[hrs_index]; 3266 marked_bytes += marked_bytes_array[hrm_index];
3267 3267
3268 // Now union the bitmaps[0,max_worker_id)[start_idx..limit_idx) 3268 // Now union the bitmaps[0,max_worker_id)[start_idx..limit_idx)
3269 // into the global card bitmap. 3269 // into the global card bitmap.
3270 BitMap::idx_t scan_idx = task_card_bm->get_next_one_offset(start_idx, limit_idx); 3270 BitMap::idx_t scan_idx = task_card_bm->get_next_one_offset(start_idx, limit_idx);
3271 3271