38 *
39 * It is implemented in four phases:
40 *
41 * 1. Mark all live objects of the heap by traversing objects starting at GC roots.
42 * 2. Calculate the new location of each live object. This is done by sequentially scanning
43 * the heap, keeping track of a next-location-pointer, which is then written to each
44 * object's fwdptr field.
45 * 3. Update all references. This is implemented by another scan of the heap, and updates
46 * all references in live objects by what's stored in the target object's fwdptr.
47 * 4. Compact the heap by copying all live objects to their new location.
48 *
49 * Parallelization is handled by assigning each GC worker the slice of the heap (the set of regions)
50 * where it does sliding compaction, without interfering with other threads.
51 */
52
53 class PreservedMarksSet;
54 class VM_ShenandoahFullGC;
55 class ShenandoahDegenGC;
56
57 class ShenandoahFullGC : public ShenandoahGC {
58 friend class ShenandoahPrepareForCompactionObjectClosure;
59 friend class VM_ShenandoahFullGC;
60 friend class ShenandoahDegenGC;
61
62 private:
63 GCTimer* _gc_timer;
64
65 PreservedMarksSet* _preserved_marks;
66
67 public:
68 ShenandoahFullGC();
69 ~ShenandoahFullGC();
70 bool collect(GCCause::Cause cause);
71
72 private:
73 // GC entries
74 void vmop_entry_full(GCCause::Cause cause);
75 void entry_full(GCCause::Cause cause);
76 void op_full(GCCause::Cause cause);
77
78 void do_it(GCCause::Cause gc_cause);
79
80 void phase1_mark_heap();
81 void phase2_calculate_target_addresses(ShenandoahHeapRegionSet** worker_slices);
82 void phase3_update_references();
83 void phase4_compact_objects(ShenandoahHeapRegionSet** worker_slices);
84
85 void distribute_slices(ShenandoahHeapRegionSet** worker_slices);
86 void calculate_target_humongous_objects();
87 void compact_humongous_objects();
88 };
89
90 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP
|
38 *
39 * It is implemented in four phases:
40 *
41 * 1. Mark all live objects of the heap by traversing objects starting at GC roots.
42 * 2. Calculate the new location of each live object. This is done by sequentially scanning
43 * the heap, keeping track of a next-location-pointer, which is then written to each
44 * object's fwdptr field.
45 * 3. Update all references. This is implemented by another scan of the heap, and updates
46 * all references in live objects by what's stored in the target object's fwdptr.
47 * 4. Compact the heap by copying all live objects to their new location.
48 *
49 * Parallelization is handled by assigning each GC worker the slice of the heap (the set of regions)
50 * where it does sliding compaction, without interfering with other threads.
51 */
52
53 class PreservedMarksSet;
54 class VM_ShenandoahFullGC;
55 class ShenandoahDegenGC;
56
57 class ShenandoahFullGC : public ShenandoahGC {
58 template <bool ALT_FWD>
59 friend class ShenandoahPrepareForCompactionObjectClosure;
60 friend class VM_ShenandoahFullGC;
61 friend class ShenandoahDegenGC;
62
63 private:
64 GCTimer* _gc_timer;
65
66 PreservedMarksSet* _preserved_marks;
67
68 public:
69 ShenandoahFullGC();
70 ~ShenandoahFullGC();
71 bool collect(GCCause::Cause cause);
72
73 private:
74 // GC entries
75 void vmop_entry_full(GCCause::Cause cause);
76 void entry_full(GCCause::Cause cause);
77 void op_full(GCCause::Cause cause);
78
79 void do_it(GCCause::Cause gc_cause);
80
81 void phase1_mark_heap();
82 void phase2_calculate_target_addresses(ShenandoahHeapRegionSet** worker_slices);
83 void phase3_update_references();
84 void phase4_compact_objects(ShenandoahHeapRegionSet** worker_slices);
85
86 void distribute_slices(ShenandoahHeapRegionSet** worker_slices);
87 template <bool ALT_FWD>
88 void calculate_target_humongous_objects_impl();
89 void calculate_target_humongous_objects();
90 template <bool ALT_FWD>
91 void compact_humongous_objects_impl();
92 void compact_humongous_objects();
93 };
94
95 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHFULLGC_HPP
|