Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @ 2361:1216415d8e35
7014923: G1: code cleanup
Summary: Some G1 code cleanup.
Reviewed-by: johnc, jcoomes, jwilhelm
author | tonyp |
---|---|
date | Fri, 04 Mar 2011 17:13:19 -0500 |
parents | 3582bf76420e |
children | 6747fd0512e0 |
comparison
equal
deleted
inserted
replaced
2312:11303bede852 | 2361:1216415d8e35 |
---|---|
183 | 183 |
184 class G1PrepareCompactClosure: public HeapRegionClosure { | 184 class G1PrepareCompactClosure: public HeapRegionClosure { |
185 G1CollectedHeap* _g1h; | 185 G1CollectedHeap* _g1h; |
186 ModRefBarrierSet* _mrbs; | 186 ModRefBarrierSet* _mrbs; |
187 CompactPoint _cp; | 187 CompactPoint _cp; |
188 size_t _pre_used; | |
189 FreeRegionList _free_list; | |
190 HumongousRegionSet _humongous_proxy_set; | 188 HumongousRegionSet _humongous_proxy_set; |
191 | 189 |
192 void free_humongous_region(HeapRegion* hr) { | 190 void free_humongous_region(HeapRegion* hr) { |
193 HeapWord* end = hr->end(); | 191 HeapWord* end = hr->end(); |
192 size_t dummy_pre_used; | |
193 FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep"); | |
194 | |
194 assert(hr->startsHumongous(), | 195 assert(hr->startsHumongous(), |
195 "Only the start of a humongous region should be freed."); | 196 "Only the start of a humongous region should be freed."); |
196 _g1h->free_humongous_region(hr, &_pre_used, &_free_list, | 197 _g1h->free_humongous_region(hr, &dummy_pre_used, &dummy_free_list, |
197 &_humongous_proxy_set, false /* par */); | 198 &_humongous_proxy_set, false /* par */); |
198 // Do we also need to do this for the continues humongous regions | |
199 // we just collapsed? | |
200 hr->prepare_for_compaction(&_cp); | 199 hr->prepare_for_compaction(&_cp); |
201 // Also clear the part of the card table that will be unused after | 200 // Also clear the part of the card table that will be unused after |
202 // compaction. | 201 // compaction. |
203 _mrbs->clear(MemRegion(hr->compaction_top(), end)); | 202 _mrbs->clear(MemRegion(hr->compaction_top(), end)); |
203 dummy_free_list.remove_all(); | |
204 } | 204 } |
205 | 205 |
206 public: | 206 public: |
207 G1PrepareCompactClosure(CompactibleSpace* cs) | 207 G1PrepareCompactClosure(CompactibleSpace* cs) |
208 : _g1h(G1CollectedHeap::heap()), | 208 : _g1h(G1CollectedHeap::heap()), |
209 _mrbs(G1CollectedHeap::heap()->mr_bs()), | 209 _mrbs(G1CollectedHeap::heap()->mr_bs()), |
210 _cp(NULL, cs, cs->initialize_threshold()), | 210 _cp(NULL, cs, cs->initialize_threshold()), |
211 _pre_used(0), | |
212 _free_list("Local Free List for G1MarkSweep"), | |
213 _humongous_proxy_set("G1MarkSweep Humongous Proxy Set") { } | 211 _humongous_proxy_set("G1MarkSweep Humongous Proxy Set") { } |
214 | 212 |
215 void update_sets() { | 213 void update_sets() { |
216 // We'll recalculate total used bytes and recreate the free list | 214 // We'll recalculate total used bytes and recreate the free list |
217 // at the end of the GC, so no point in updating those values here. | 215 // at the end of the GC, so no point in updating those values here. |
218 _g1h->update_sets_after_freeing_regions(0, /* pre_used */ | 216 _g1h->update_sets_after_freeing_regions(0, /* pre_used */ |
219 NULL, /* free_list */ | 217 NULL, /* free_list */ |
220 &_humongous_proxy_set, | 218 &_humongous_proxy_set, |
221 false /* par */); | 219 false /* par */); |
222 _free_list.remove_all(); | |
223 } | 220 } |
224 | 221 |
225 bool doHeapRegion(HeapRegion* hr) { | 222 bool doHeapRegion(HeapRegion* hr) { |
226 if (hr->isHumongous()) { | 223 if (hr->isHumongous()) { |
227 if (hr->startsHumongous()) { | 224 if (hr->startsHumongous()) { |