Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 4787:2ace1c4ee8da
6888336: G1: avoid explicitly marking and pushing objects in survivor spaces
Summary: This change simplifies the interaction between GC and concurrent marking. By disabling survivor spaces during the initial-mark pause we don't need to propagate marks of objects we copy during each GC (since we never need to copy an explicitly marked object).
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Tue, 10 Jan 2012 18:58:13 -0500 |
parents | 023652e49ac0 |
children | 9509c20bba28 |
comparison
equal
deleted
inserted
replaced
4786:1d6185f732aa | 4787:2ace1c4ee8da |
---|---|
867 // Do any necessary cleanup for evacuation-failure handling data | 867 // Do any necessary cleanup for evacuation-failure handling data |
868 // structures. | 868 // structures. |
869 void finalize_for_evac_failure(); | 869 void finalize_for_evac_failure(); |
870 | 870 |
871 // An attempt to evacuate "obj" has failed; take necessary steps. | 871 // An attempt to evacuate "obj" has failed; take necessary steps. |
872 oop handle_evacuation_failure_par(OopsInHeapRegionClosure* cl, oop obj, | 872 oop handle_evacuation_failure_par(OopsInHeapRegionClosure* cl, oop obj); |
873 bool should_mark_root); | |
874 void handle_evacuation_failure_common(oop obj, markOop m); | 873 void handle_evacuation_failure_common(oop obj, markOop m); |
875 | 874 |
876 // ("Weak") Reference processing support. | 875 // ("Weak") Reference processing support. |
877 // | 876 // |
878 // G1 has 2 instances of the referece processor class. One | 877 // G1 has 2 instances of the referece processor class. One |
960 // the associated time stamp value matches the current value | 959 // the associated time stamp value matches the current value |
961 // of G1CollectedHeap::_gc_time_stamp. | 960 // of G1CollectedHeap::_gc_time_stamp. |
962 unsigned int* _worker_cset_start_region_time_stamp; | 961 unsigned int* _worker_cset_start_region_time_stamp; |
963 | 962 |
964 enum G1H_process_strong_roots_tasks { | 963 enum G1H_process_strong_roots_tasks { |
965 G1H_PS_mark_stack_oops_do, | 964 G1H_PS_filter_satb_buffers, |
966 G1H_PS_refProcessor_oops_do, | 965 G1H_PS_refProcessor_oops_do, |
967 // Leave this one last. | 966 // Leave this one last. |
968 G1H_PS_NumElements | 967 G1H_PS_NumElements |
969 }; | 968 }; |
970 | 969 |
1750 _bitmap_word_covers_words(bitmap_word_covers_words()), | 1749 _bitmap_word_covers_words(bitmap_word_covers_words()), |
1751 _heap_start(heap_start), | 1750 _heap_start(heap_start), |
1752 _gclab_word_size(gclab_word_size), | 1751 _gclab_word_size(gclab_word_size), |
1753 _real_start_word(NULL), | 1752 _real_start_word(NULL), |
1754 _real_end_word(NULL), | 1753 _real_end_word(NULL), |
1755 _start_word(NULL) | 1754 _start_word(NULL) { |
1756 { | 1755 guarantee(false, "GCLabBitMap::GCLabBitmap(): don't call this any more"); |
1757 guarantee( size_in_words() >= bitmap_size_in_words(), | |
1758 "just making sure"); | |
1759 } | 1756 } |
1760 | 1757 |
1761 inline unsigned heapWordToOffset(HeapWord* addr) { | 1758 inline unsigned heapWordToOffset(HeapWord* addr) { |
1762 unsigned offset = (unsigned) pointer_delta(addr, _start_word) >> _shifter; | 1759 unsigned offset = (unsigned) pointer_delta(addr, _start_word) >> _shifter; |
1763 assert(offset < size(), "offset should be within bounds"); | 1760 assert(offset < size(), "offset should be within bounds"); |
1807 | 1804 |
1808 return at(heapWordToOffset(addr)); | 1805 return at(heapWordToOffset(addr)); |
1809 } | 1806 } |
1810 | 1807 |
1811 void set_buffer(HeapWord* start) { | 1808 void set_buffer(HeapWord* start) { |
1809 guarantee(false, "set_buffer(): don't call this any more"); | |
1810 | |
1812 guarantee(use_local_bitmaps, "invariant"); | 1811 guarantee(use_local_bitmaps, "invariant"); |
1813 clear(); | 1812 clear(); |
1814 | 1813 |
1815 assert(start != NULL, "invariant"); | 1814 assert(start != NULL, "invariant"); |
1816 _real_start_word = start; | 1815 _real_start_word = start; |
1830 iterate(&cl); | 1829 iterate(&cl); |
1831 } | 1830 } |
1832 #endif // PRODUCT | 1831 #endif // PRODUCT |
1833 | 1832 |
1834 void retire() { | 1833 void retire() { |
1834 guarantee(false, "retire(): don't call this any more"); | |
1835 | |
1835 guarantee(use_local_bitmaps, "invariant"); | 1836 guarantee(use_local_bitmaps, "invariant"); |
1836 assert(fields_well_formed(), "invariant"); | 1837 assert(fields_well_formed(), "invariant"); |
1837 | 1838 |
1838 if (_start_word != NULL) { | 1839 if (_start_word != NULL) { |
1839 CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); | 1840 CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); |
1863 }; | 1864 }; |
1864 | 1865 |
1865 class G1ParGCAllocBuffer: public ParGCAllocBuffer { | 1866 class G1ParGCAllocBuffer: public ParGCAllocBuffer { |
1866 private: | 1867 private: |
1867 bool _retired; | 1868 bool _retired; |
1868 bool _should_mark_objects; | |
1869 GCLabBitMap _bitmap; | |
1870 | 1869 |
1871 public: | 1870 public: |
1872 G1ParGCAllocBuffer(size_t gclab_word_size); | 1871 G1ParGCAllocBuffer(size_t gclab_word_size); |
1873 | 1872 |
1874 inline bool mark(HeapWord* addr) { | 1873 void set_buf(HeapWord* buf) { |
1875 guarantee(use_local_bitmaps, "invariant"); | |
1876 assert(_should_mark_objects, "invariant"); | |
1877 return _bitmap.mark(addr); | |
1878 } | |
1879 | |
1880 inline void set_buf(HeapWord* buf) { | |
1881 if (use_local_bitmaps && _should_mark_objects) { | |
1882 _bitmap.set_buffer(buf); | |
1883 } | |
1884 ParGCAllocBuffer::set_buf(buf); | 1874 ParGCAllocBuffer::set_buf(buf); |
1885 _retired = false; | 1875 _retired = false; |
1886 } | 1876 } |
1887 | 1877 |
1888 inline void retire(bool end_of_gc, bool retain) { | 1878 void retire(bool end_of_gc, bool retain) { |
1889 if (_retired) | 1879 if (_retired) |
1890 return; | 1880 return; |
1891 if (use_local_bitmaps && _should_mark_objects) { | |
1892 _bitmap.retire(); | |
1893 } | |
1894 ParGCAllocBuffer::retire(end_of_gc, retain); | 1881 ParGCAllocBuffer::retire(end_of_gc, retain); |
1895 _retired = true; | 1882 _retired = true; |
1896 } | 1883 } |
1897 }; | 1884 }; |
1898 | 1885 |