23
24 #include "gc/shared/gcTraceTime.inline.hpp"
25 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
26 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
27 #include "gc/shenandoah/vm_operations_shenandoah.hpp"
28 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
29
30 VM_Operation::VMOp_Type VM_ShenandoahInitMark::type() const {
31 return VMOp_ShenandoahInitMark;
32 }
33
34 const char* VM_ShenandoahInitMark::name() const {
35 return "Shenandoah Initial Marking";
36 }
37
38 void VM_ShenandoahInitMark::doit() {
39 ShenandoahHeap *sh = (ShenandoahHeap*) Universe::heap();
40 GCTraceTime(Info, gc) time("Pause Init-Mark", sh->gc_timer());
41 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::init_mark);
42
43 assert(sh->is_bitmap_clear(), "need clear marking bitmap");
44
45 sh->start_concurrent_marking();
46 if (UseTLAB) {
47 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::resize_tlabs);
48 sh->resize_all_tlabs();
49 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::resize_tlabs);
50 }
51
52 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::init_mark);
53
54 }
55
56 VM_Operation::VMOp_Type VM_ShenandoahFullGC::type() const {
57 return VMOp_ShenandoahFullGC;
58 }
59
60 VM_ShenandoahFullGC::VM_ShenandoahFullGC(GCCause::Cause gc_cause) :
61 _gc_cause(gc_cause) {
62 }
63
102 sh->stop_concurrent_marking();
103 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::final_mark);
104
105 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::prepare_evac);
106 sh->prepare_for_concurrent_evacuation();
107 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::prepare_evac);
108
109 sh->set_evacuation_in_progress(true);
110
111 // From here on, we need to update references.
112 sh->set_need_update_refs(true);
113
114 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::init_evac);
115 sh->evacuate_and_update_roots();
116 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::init_evac);
117
118 } else {
119 GCTraceTime(Info, gc) time("Cancel concurrent Mark", sh->gc_timer(), GCCause::_no_gc, true);
120 sh->concurrentMark()->cancel();
121 sh->stop_concurrent_marking();
122 sh->recycle_dirty_regions();
123 }
124 }
125
126 VM_Operation::VMOp_Type VM_ShenandoahStartEvacuation::type() const {
127 return VMOp_ShenandoahStartEvacuation;
128 }
129
130 const char* VM_ShenandoahStartEvacuation::name() const {
131 return "Start shenandoah evacuation";
132 }
133
134 VM_Operation::VMOp_Type VM_ShenandoahVerifyHeapAfterEvacuation::type() const {
135 return VMOp_ShenandoahVerifyHeapAfterEvacuation;
136 }
137
138 const char* VM_ShenandoahVerifyHeapAfterEvacuation::name() const {
139 return "Shenandoah verify heap after evacuation";
140 }
141
142 void VM_ShenandoahVerifyHeapAfterEvacuation::doit() {
|
23
24 #include "gc/shared/gcTraceTime.inline.hpp"
25 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
26 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
27 #include "gc/shenandoah/vm_operations_shenandoah.hpp"
28 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
29
30 VM_Operation::VMOp_Type VM_ShenandoahInitMark::type() const {
31 return VMOp_ShenandoahInitMark;
32 }
33
34 const char* VM_ShenandoahInitMark::name() const {
35 return "Shenandoah Initial Marking";
36 }
37
38 void VM_ShenandoahInitMark::doit() {
39 ShenandoahHeap *sh = (ShenandoahHeap*) Universe::heap();
40 GCTraceTime(Info, gc) time("Pause Init-Mark", sh->gc_timer());
41 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::init_mark);
42
43 assert(sh->is_next_bitmap_clear(), "need clear marking bitmap");
44
45 sh->start_concurrent_marking();
46 if (UseTLAB) {
47 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::resize_tlabs);
48 sh->resize_all_tlabs();
49 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::resize_tlabs);
50 }
51
52 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::init_mark);
53
54 }
55
56 VM_Operation::VMOp_Type VM_ShenandoahFullGC::type() const {
57 return VMOp_ShenandoahFullGC;
58 }
59
60 VM_ShenandoahFullGC::VM_ShenandoahFullGC(GCCause::Cause gc_cause) :
61 _gc_cause(gc_cause) {
62 }
63
102 sh->stop_concurrent_marking();
103 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::final_mark);
104
105 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::prepare_evac);
106 sh->prepare_for_concurrent_evacuation();
107 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::prepare_evac);
108
109 sh->set_evacuation_in_progress(true);
110
111 // From here on, we need to update references.
112 sh->set_need_update_refs(true);
113
114 sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::init_evac);
115 sh->evacuate_and_update_roots();
116 sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::init_evac);
117
118 } else {
119 GCTraceTime(Info, gc) time("Cancel concurrent Mark", sh->gc_timer(), GCCause::_no_gc, true);
120 sh->concurrentMark()->cancel();
121 sh->stop_concurrent_marking();
122 }
123 }
124
125 VM_Operation::VMOp_Type VM_ShenandoahStartEvacuation::type() const {
126 return VMOp_ShenandoahStartEvacuation;
127 }
128
129 const char* VM_ShenandoahStartEvacuation::name() const {
130 return "Start shenandoah evacuation";
131 }
132
133 VM_Operation::VMOp_Type VM_ShenandoahVerifyHeapAfterEvacuation::type() const {
134 return VMOp_ShenandoahVerifyHeapAfterEvacuation;
135 }
136
137 const char* VM_ShenandoahVerifyHeapAfterEvacuation::name() const {
138 return "Shenandoah verify heap after evacuation";
139 }
140
141 void VM_ShenandoahVerifyHeapAfterEvacuation::doit() {
|