208 }; |
208 }; |
209 |
209 |
210 class RefineCardTableEntryClosure; |
210 class RefineCardTableEntryClosure; |
211 |
211 |
212 class G1CollectedHeap : public SharedHeap { |
212 class G1CollectedHeap : public SharedHeap { |
|
213 friend class VM_CollectForMetadataAllocation; |
213 friend class VM_G1CollectForAllocation; |
214 friend class VM_G1CollectForAllocation; |
214 friend class VM_G1CollectFull; |
215 friend class VM_G1CollectFull; |
215 friend class VM_G1IncCollectionPause; |
216 friend class VM_G1IncCollectionPause; |
216 friend class VMStructs; |
217 friend class VMStructs; |
217 friend class MutatorAllocRegion; |
218 friend class MutatorAllocRegion; |
218 friend class SurvivorGCAllocRegion; |
219 friend class SurvivorGCAllocRegion; |
219 friend class OldGCAllocRegion; |
220 friend class OldGCAllocRegion; |
220 |
221 |
221 // Closures used in implementation. |
222 // Closures used in implementation. |
222 template <G1Barrier barrier, bool do_mark_object> |
223 template <G1Barrier barrier, G1Mark do_mark_object> |
223 friend class G1ParCopyClosure; |
224 friend class G1ParCopyClosure; |
224 friend class G1IsAliveClosure; |
225 friend class G1IsAliveClosure; |
225 friend class G1EvacuateFollowersClosure; |
226 friend class G1EvacuateFollowersClosure; |
226 friend class G1ParScanThreadState; |
227 friend class G1ParScanThreadState; |
227 friend class G1ParScanClosureSuper; |
228 friend class G1ParScanClosureSuper; |
343 // It releases the mutator alloc region. |
344 // It releases the mutator alloc region. |
344 void release_mutator_alloc_region(); |
345 void release_mutator_alloc_region(); |
345 |
346 |
346 // It initializes the GC alloc regions at the start of a GC. |
347 // It initializes the GC alloc regions at the start of a GC. |
347 void init_gc_alloc_regions(EvacuationInfo& evacuation_info); |
348 void init_gc_alloc_regions(EvacuationInfo& evacuation_info); |
|
349 |
|
350 // Setup the retained old gc alloc region as the currrent old gc alloc region. |
|
351 void use_retained_old_gc_alloc_region(EvacuationInfo& evacuation_info); |
348 |
352 |
349 // It releases the GC alloc regions at the end of a GC. |
353 // It releases the GC alloc regions at the end of a GC. |
350 void release_gc_alloc_regions(uint no_of_gc_workers, EvacuationInfo& evacuation_info); |
354 void release_gc_alloc_regions(uint no_of_gc_workers, EvacuationInfo& evacuation_info); |
351 |
355 |
352 // It does any cleanup that needs to be done on the GC alloc regions |
356 // It does any cleanup that needs to be done on the GC alloc regions |
825 // and does "scan_metadata" If "scan_rs" is |
829 // and does "scan_metadata" If "scan_rs" is |
826 // NULL, then this step is skipped. The "worker_i" |
830 // NULL, then this step is skipped. The "worker_i" |
827 // param is for use with parallel roots processing, and should be |
831 // param is for use with parallel roots processing, and should be |
828 // the "i" of the calling parallel worker thread's work(i) function. |
832 // the "i" of the calling parallel worker thread's work(i) function. |
829 // In the sequential case this param will be ignored. |
833 // In the sequential case this param will be ignored. |
830 void g1_process_strong_roots(bool is_scavenging, |
834 void g1_process_roots(OopClosure* scan_non_heap_roots, |
831 ScanningOption so, |
835 OopClosure* scan_non_heap_weak_roots, |
832 OopClosure* scan_non_heap_roots, |
836 OopsInHeapRegionClosure* scan_rs, |
833 OopsInHeapRegionClosure* scan_rs, |
837 CLDClosure* scan_strong_clds, |
834 G1KlassScanClosure* scan_klasses, |
838 CLDClosure* scan_weak_clds, |
835 uint worker_i); |
839 CodeBlobClosure* scan_strong_code, |
|
840 uint worker_i); |
836 |
841 |
837 // Notifies all the necessary spaces that the committed space has |
842 // Notifies all the necessary spaces that the committed space has |
838 // been updated (either expanded or shrunk). It should be called |
843 // been updated (either expanded or shrunk). It should be called |
839 // after _g1_storage is updated. |
844 // after _g1_storage is updated. |
840 void update_committed_space(HeapWord* old_end, HeapWord* new_end); |
845 void update_committed_space(HeapWord* old_end, HeapWord* new_end); |
1023 // The heap region entry for a given worker is valid iff |
1028 // The heap region entry for a given worker is valid iff |
1024 // the associated time stamp value matches the current value |
1029 // the associated time stamp value matches the current value |
1025 // of G1CollectedHeap::_gc_time_stamp. |
1030 // of G1CollectedHeap::_gc_time_stamp. |
1026 unsigned int* _worker_cset_start_region_time_stamp; |
1031 unsigned int* _worker_cset_start_region_time_stamp; |
1027 |
1032 |
1028 enum G1H_process_strong_roots_tasks { |
1033 enum G1H_process_roots_tasks { |
1029 G1H_PS_filter_satb_buffers, |
1034 G1H_PS_filter_satb_buffers, |
1030 G1H_PS_refProcessor_oops_do, |
1035 G1H_PS_refProcessor_oops_do, |
1031 // Leave this one last. |
1036 // Leave this one last. |
1032 G1H_PS_NumElements |
1037 G1H_PS_NumElements |
1033 }; |
1038 }; |
1605 void migrate_strong_code_roots(); |
1610 void migrate_strong_code_roots(); |
1606 |
1611 |
1607 // Free up superfluous code root memory. |
1612 // Free up superfluous code root memory. |
1608 void purge_code_root_memory(); |
1613 void purge_code_root_memory(); |
1609 |
1614 |
1610 // During an initial mark pause, mark all the code roots that |
|
1611 // point into regions *not* in the collection set. |
|
1612 void mark_strong_code_roots(uint worker_id); |
|
1613 |
|
1614 // Rebuild the strong code root lists for each region |
1615 // Rebuild the strong code root lists for each region |
1615 // after a full GC. |
1616 // after a full GC. |
1616 void rebuild_strong_code_roots(); |
1617 void rebuild_strong_code_roots(); |
1617 |
1618 |
1618 // Delete entries for dead interned string and clean up unreferenced symbols |
1619 // Delete entries for dead interned string and clean up unreferenced symbols |
1619 // in symbol table, possibly in parallel. |
1620 // in symbol table, possibly in parallel. |
1620 void unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool unlink_strings = true, bool unlink_symbols = true); |
1621 void unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool unlink_strings = true, bool unlink_symbols = true); |
|
1622 |
|
1623 // Parallel phase of unloading/cleaning after G1 concurrent mark. |
|
1624 void parallel_cleaning(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols, bool class_unloading_occurred); |
1621 |
1625 |
1622 // Redirty logged cards in the refinement queue. |
1626 // Redirty logged cards in the refinement queue. |
1623 void redirty_logged_cards(); |
1627 void redirty_logged_cards(); |
1624 // Verification |
1628 // Verification |
1625 |
1629 |