Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 545:58054a18d735
6484959: G1: introduce survivor spaces
6797754: G1: combined bugfix
Summary: Implemented a policy to control G1 survivor space parameters.
Reviewed-by: tonyp, iveresov
author | apetrusenko |
---|---|
date | Fri, 06 Feb 2009 01:38:50 +0300 |
parents | 818efdefcc99 |
children | 0fbdb4381b99 4f360ec815ba |
comparison
equal
deleted
inserted
replaced
544:82a980778b92 | 545:58054a18d735 |
---|---|
88 size_t _sampled_rs_lengths; | 88 size_t _sampled_rs_lengths; |
89 HeapRegion* _curr; | 89 HeapRegion* _curr; |
90 HeapRegion* _curr_scan_only; | 90 HeapRegion* _curr_scan_only; |
91 | 91 |
92 HeapRegion* _survivor_head; | 92 HeapRegion* _survivor_head; |
93 HeapRegion* _survivors_tail; | 93 HeapRegion* _survivor_tail; |
94 size_t _survivor_length; | 94 size_t _survivor_length; |
95 | 95 |
96 void empty_list(HeapRegion* list); | 96 void empty_list(HeapRegion* list); |
97 | 97 |
98 public: | 98 public: |
103 HeapRegion* pop_region(); | 103 HeapRegion* pop_region(); |
104 void empty_list(); | 104 void empty_list(); |
105 bool is_empty() { return _length == 0; } | 105 bool is_empty() { return _length == 0; } |
106 size_t length() { return _length; } | 106 size_t length() { return _length; } |
107 size_t scan_only_length() { return _scan_only_length; } | 107 size_t scan_only_length() { return _scan_only_length; } |
108 size_t survivor_length() { return _survivor_length; } | |
108 | 109 |
109 void rs_length_sampling_init(); | 110 void rs_length_sampling_init(); |
110 bool rs_length_sampling_more(); | 111 bool rs_length_sampling_more(); |
111 void rs_length_sampling_next(); | 112 void rs_length_sampling_next(); |
112 | 113 |
118 // for development purposes | 119 // for development purposes |
119 void reset_auxilary_lists(); | 120 void reset_auxilary_lists(); |
120 HeapRegion* first_region() { return _head; } | 121 HeapRegion* first_region() { return _head; } |
121 HeapRegion* first_scan_only_region() { return _scan_only_head; } | 122 HeapRegion* first_scan_only_region() { return _scan_only_head; } |
122 HeapRegion* first_survivor_region() { return _survivor_head; } | 123 HeapRegion* first_survivor_region() { return _survivor_head; } |
124 HeapRegion* last_survivor_region() { return _survivor_tail; } | |
123 HeapRegion* par_get_next_scan_only_region() { | 125 HeapRegion* par_get_next_scan_only_region() { |
124 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); | 126 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); |
125 HeapRegion* ret = _curr_scan_only; | 127 HeapRegion* ret = _curr_scan_only; |
126 if (ret != NULL) | 128 if (ret != NULL) |
127 _curr_scan_only = ret->get_next_young_region(); | 129 _curr_scan_only = ret->get_next_young_region(); |
217 void abandon_cur_alloc_region(); | 219 void abandon_cur_alloc_region(); |
218 | 220 |
219 // The to-space memory regions into which objects are being copied during | 221 // The to-space memory regions into which objects are being copied during |
220 // a GC. | 222 // a GC. |
221 HeapRegion* _gc_alloc_regions[GCAllocPurposeCount]; | 223 HeapRegion* _gc_alloc_regions[GCAllocPurposeCount]; |
222 uint _gc_alloc_region_counts[GCAllocPurposeCount]; | 224 size_t _gc_alloc_region_counts[GCAllocPurposeCount]; |
223 | 225 |
224 // A list of the regions that have been set to be alloc regions in the | 226 // A list of the regions that have been set to be alloc regions in the |
225 // current collection. | 227 // current collection. |
226 HeapRegion* _gc_alloc_region_list; | 228 HeapRegion* _gc_alloc_region_list; |
227 | 229 |
279 protected: | 281 protected: |
280 | 282 |
281 // Returns "true" iff none of the gc alloc regions have any allocations | 283 // Returns "true" iff none of the gc alloc regions have any allocations |
282 // since the last call to "save_marks". | 284 // since the last call to "save_marks". |
283 bool all_alloc_regions_no_allocs_since_save_marks(); | 285 bool all_alloc_regions_no_allocs_since_save_marks(); |
284 // Calls "note_end_of_copying on all gc alloc_regions. | 286 // Perform finalization stuff on all allocation regions. |
285 void all_alloc_regions_note_end_of_copying(); | 287 void retire_all_alloc_regions(); |
286 | 288 |
287 // The number of regions allocated to hold humongous objects. | 289 // The number of regions allocated to hold humongous objects. |
288 int _num_humongous_regions; | 290 int _num_humongous_regions; |
289 YoungList* _young_list; | 291 YoungList* _young_list; |
290 | 292 |
348 size_t word_size); | 350 size_t word_size); |
349 | 351 |
350 // Ensure that no further allocations can happen in "r", bearing in mind | 352 // Ensure that no further allocations can happen in "r", bearing in mind |
351 // that parallel threads might be attempting allocations. | 353 // that parallel threads might be attempting allocations. |
352 void par_allocate_remaining_space(HeapRegion* r); | 354 void par_allocate_remaining_space(HeapRegion* r); |
355 | |
356 // Retires an allocation region when it is full or at the end of a | |
357 // GC pause. | |
358 void retire_alloc_region(HeapRegion* alloc_region, bool par); | |
353 | 359 |
354 // Helper function for two callbacks below. | 360 // Helper function for two callbacks below. |
355 // "full", if true, indicates that the GC is for a System.gc() request, | 361 // "full", if true, indicates that the GC is for a System.gc() request, |
356 // and should collect the entire heap. If "clear_all_soft_refs" is true, | 362 // and should collect the entire heap. If "clear_all_soft_refs" is true, |
357 // all soft references are cleared during the GC. If "full" is false, | 363 // all soft references are cleared during the GC. If "full" is false, |