Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 20336:6701abbc4441
8054818: Refactor HeapRegionSeq to manage heap region and auxiliary data
Summary: Let HeapRegionSeq manage the heap region and auxiliary data to decrease the amount of responsibilities of G1CollectedHeap, and encapsulate this work from other code.
Reviewed-by: jwilhelm, jmasa, mgerdin, brutisso
author | tschatzl |
---|---|
date | Tue, 19 Aug 2014 10:50:27 +0200 |
parents | eec72fa4b108 |
children | 1f1d373cd044 |
comparison
equal
deleted
inserted
replaced
20335:eec72fa4b108 | 20336:6701abbc4441 |
---|---|
726 _heap_start = (HeapWord*) heap_rs.base(); | 726 _heap_start = (HeapWord*) heap_rs.base(); |
727 set_non_marking_state(); | 727 set_non_marking_state(); |
728 _completed_initialization = true; | 728 _completed_initialization = true; |
729 } | 729 } |
730 | 730 |
731 void ConcurrentMark::update_g1_committed(bool force) { | 731 void ConcurrentMark::update_heap_boundaries(MemRegion bounds, bool force) { |
732 // If concurrent marking is not in progress, then we do not need to | 732 // If concurrent marking is not in progress, then we do not need to |
733 // update _heap_end. | 733 // update _heap_end. |
734 if (!concurrent_marking_in_progress() && !force) return; | 734 if (!concurrent_marking_in_progress() && !force) return; |
735 | 735 |
736 MemRegion committed = _g1h->g1_committed(); | 736 assert(bounds.start() == _heap_start, "start shouldn't change"); |
737 assert(committed.start() == _heap_start, "start shouldn't change"); | 737 HeapWord* new_end = bounds.end(); |
738 HeapWord* new_end = committed.end(); | |
739 if (new_end > _heap_end) { | 738 if (new_end > _heap_end) { |
740 // The heap has been expanded. | 739 // The heap has been expanded. |
741 | 740 |
742 _heap_end = new_end; | 741 _heap_end = new_end; |
743 } | 742 } |
824 // in a STW phase. | 823 // in a STW phase. |
825 assert(!concurrent_marking_in_progress(), "invariant"); | 824 assert(!concurrent_marking_in_progress(), "invariant"); |
826 assert(out_of_regions(), | 825 assert(out_of_regions(), |
827 err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, | 826 err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, |
828 p2i(_finger), p2i(_heap_end))); | 827 p2i(_finger), p2i(_heap_end))); |
829 update_g1_committed(true); | 828 update_heap_boundaries(_g1h->g1_committed(), true); |
830 } | 829 } |
831 } | 830 } |
832 | 831 |
833 void ConcurrentMark::set_non_marking_state() { | 832 void ConcurrentMark::set_non_marking_state() { |
834 // We set the global marking state to some default values when we're | 833 // We set the global marking state to some default values when we're |
2192 } | 2191 } |
2193 | 2192 |
2194 // Noone else should be accessing the _cleanup_list at this point, | 2193 // Noone else should be accessing the _cleanup_list at this point, |
2195 // so it's not necessary to take any locks | 2194 // so it's not necessary to take any locks |
2196 while (!_cleanup_list.is_empty()) { | 2195 while (!_cleanup_list.is_empty()) { |
2197 HeapRegion* hr = _cleanup_list.remove_head(); | 2196 HeapRegion* hr = _cleanup_list.remove_region(true /* from_head */); |
2198 assert(hr != NULL, "Got NULL from a non-empty list"); | 2197 assert(hr != NULL, "Got NULL from a non-empty list"); |
2199 hr->par_clear(); | 2198 hr->par_clear(); |
2200 tmp_free_list.add_ordered(hr); | 2199 tmp_free_list.add_ordered(hr); |
2201 | 2200 |
2202 // Instead of adding one region at a time to the secondary_free_list, | 2201 // Instead of adding one region at a time to the secondary_free_list, |