148
149 _heap->gc_prologue(true);
150 _heap->prepare_heap_for_full_collection();
151
152 reference_processor()->enable_discovery();
153 reference_processor()->setup_policy(scope()->should_clear_soft_refs());
154
155 // When collecting the permanent generation Method*s may be moving,
156 // so we either have to flush all bcp data or convert it into bci.
157 CodeCache::gc_prologue();
158
159 // We should save the marks of the currently locked biased monitors.
160 // The marking doesn't preserve the marks of biased objects.
161 BiasedLocking::preserve_marks();
162
163 // Clear and activate derived pointer collection.
164 clear_and_activate_derived_pointers();
165 }
166
167 void G1FullCollector::collect() {
168 phase1_mark_live_objects();
169 verify_after_marking();
170
171 // Don't add any more derived pointers during later phases
172 deactivate_derived_pointers();
173
174 phase2_prepare_compaction();
175
176 phase3_adjust_pointers();
177
178 phase4_do_compaction();
179 }
180
181 void G1FullCollector::complete_collection() {
182 // Restore all marks.
183 restore_marks();
184
185 // When the pointers have been adjusted and moved, we can
186 // update the derived pointer table.
187 update_derived_pointers();
188
189 BiasedLocking::restore_marks();
190 CodeCache::gc_epilogue();
191 JvmtiExport::gc_epilogue();
192
193 _heap->prepare_heap_for_mutators();
194
195 _heap->g1_policy()->record_full_collection_end();
196 _heap->gc_epilogue(true);
197
198 _heap->verify_after_full_collection();
|
148
149 _heap->gc_prologue(true);
150 _heap->prepare_heap_for_full_collection();
151
152 reference_processor()->enable_discovery();
153 reference_processor()->setup_policy(scope()->should_clear_soft_refs());
154
155 // When collecting the permanent generation Method*s may be moving,
156 // so we either have to flush all bcp data or convert it into bci.
157 CodeCache::gc_prologue();
158
159 // We should save the marks of the currently locked biased monitors.
160 // The marking doesn't preserve the marks of biased objects.
161 BiasedLocking::preserve_marks();
162
163 // Clear and activate derived pointer collection.
164 clear_and_activate_derived_pointers();
165 }
166
167 void G1FullCollector::collect() {
168
169 if (_heap->is_hetero_heap()) {
170 static_cast <HeapRegionManagerForHeteroHeap*>(_heap->_hrm)->prepare_for_full_collection_start();
171 }
172
173 phase1_mark_live_objects();
174 verify_after_marking();
175
176 // Don't add any more derived pointers during later phases
177 deactivate_derived_pointers();
178
179 phase2_prepare_compaction();
180
181 phase3_adjust_pointers();
182
183 phase4_do_compaction();
184
185 if (_heap->is_hetero_heap()) {
186 static_cast <HeapRegionManagerForHeteroHeap*>(_heap->_hrm)->prepare_for_full_collection_end();
187 }
188 }
189
190 void G1FullCollector::complete_collection() {
191 // Restore all marks.
192 restore_marks();
193
194 // When the pointers have been adjusted and moved, we can
195 // update the derived pointer table.
196 update_derived_pointers();
197
198 BiasedLocking::restore_marks();
199 CodeCache::gc_epilogue();
200 JvmtiExport::gc_epilogue();
201
202 _heap->prepare_heap_for_mutators();
203
204 _heap->g1_policy()->record_full_collection_end();
205 _heap->gc_epilogue(true);
206
207 _heap->verify_after_full_collection();
|