35 #include "runtime/timer.hpp"
36 #include "utilities/growableArray.hpp"
37
38 class ReferenceProcessor;
39
40 // G1MarkSweep takes care of global mark-compact garbage collection for a
41 // G1CollectedHeap using a four-phase pointer forwarding algorithm. All
42 // generations are assumed to support marking; those that can also support
43 // compaction.
44 //
45 // Class unloading will only occur when a full gc is invoked.
46 class G1PrepareCompactClosure;
47 class G1ArchiveRegionMap;
48
49 class G1MarkSweep : AllStatic {
50 public:
51
52 static void invoke_at_safepoint(ReferenceProcessor* rp,
53 bool clear_all_softrefs);
54
55 static STWGCTimer* gc_timer() { return GenMarkSweep::_gc_timer; }
56 static SerialOldTracer* gc_tracer() { return GenMarkSweep::_gc_tracer; }
57
58 private:
59 // Mark live objects
60 static void mark_sweep_phase1(bool& marked_for_deopt,
61 bool clear_all_softrefs);
62 // Calculate new addresses
63 static void mark_sweep_phase2();
64 // Update pointers
65 static void mark_sweep_phase3();
66 // Move objects to new positions
67 static void mark_sweep_phase4();
68
69 static void allocate_stacks();
70 static void prepare_compaction();
71 static void prepare_compaction_work(G1PrepareCompactClosure* blk);
72 };
73
74 class G1PrepareCompactClosure : public HeapRegionClosure {
75 protected:
76 G1CollectedHeap* _g1h;
|
35 #include "runtime/timer.hpp"
36 #include "utilities/growableArray.hpp"
37
38 class ReferenceProcessor;
39
40 // G1MarkSweep takes care of global mark-compact garbage collection for a
41 // G1CollectedHeap using a four-phase pointer forwarding algorithm. All
42 // generations are assumed to support marking; those that can also support
43 // compaction.
44 //
45 // Class unloading will only occur when a full gc is invoked.
46 class G1PrepareCompactClosure;
47 class G1ArchiveRegionMap;
48
49 class G1MarkSweep : AllStatic {
50 public:
51
52 static void invoke_at_safepoint(ReferenceProcessor* rp,
53 bool clear_all_softrefs);
54
55 static STWGCTimer* gc_timer();
56 static SerialOldTracer* gc_tracer();
57
58 private:
59 // Mark live objects
60 static void mark_sweep_phase1(bool& marked_for_deopt,
61 bool clear_all_softrefs);
62 // Calculate new addresses
63 static void mark_sweep_phase2();
64 // Update pointers
65 static void mark_sweep_phase3();
66 // Move objects to new positions
67 static void mark_sweep_phase4();
68
69 static void allocate_stacks();
70 static void prepare_compaction();
71 static void prepare_compaction_work(G1PrepareCompactClosure* blk);
72 };
73
74 class G1PrepareCompactClosure : public HeapRegionClosure {
75 protected:
76 G1CollectedHeap* _g1h;
|