194 bool clear_all_softrefs) {
195 // Recursively traverse all live objects and mark them
196 GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
197 trace(" 1");
198
199 GenCollectedHeap* gch = GenCollectedHeap::heap();
200
201 // Because follow_root_closure is created statically, cannot
202 // use OopsInGenClosure constructor which takes a generation,
203 // as the Universe has not been created when the static constructors
204 // are run.
205 follow_root_closure.set_orig_generation(gch->get_gen(level));
206
207 // Need new claim bits before marking starts.
208 ClassLoaderDataGraph::clear_claimed_marks();
209
210 gch->gen_process_roots(level,
211 false, // Younger gens are not roots.
212 true, // activate StrongRootsScope
213 GenCollectedHeap::SO_None,
214 GenCollectedHeap::StrongRootsOnly,
215 &follow_root_closure,
216 &follow_root_closure,
217 &follow_cld_closure);
218
219 // Process reference objects found during marking
220 {
221 ref_processor()->setup_policy(clear_all_softrefs);
222 const ReferenceProcessorStats& stats =
223 ref_processor()->process_discovered_references(
224 &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer, _gc_tracer->gc_id());
225 gc_tracer()->report_gc_reference_stats(stats);
226 }
227
228 // This is the point where the entire marking should have completed.
229 assert(_marking_stack.is_empty(), "Marking should have completed");
230
231 // Unload classes and purge the SystemDictionary.
232 bool purged_class = SystemDictionary::do_unloading(&is_alive);
233
234 // Unload nmethods.
|
194 bool clear_all_softrefs) {
195 // Recursively traverse all live objects and mark them
196 GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
197 trace(" 1");
198
199 GenCollectedHeap* gch = GenCollectedHeap::heap();
200
201 // Because follow_root_closure is created statically, cannot
202 // use OopsInGenClosure constructor which takes a generation,
203 // as the Universe has not been created when the static constructors
204 // are run.
205 follow_root_closure.set_orig_generation(gch->get_gen(level));
206
207 // Need new claim bits before marking starts.
208 ClassLoaderDataGraph::clear_claimed_marks();
209
210 gch->gen_process_roots(level,
211 false, // Younger gens are not roots.
212 true, // activate StrongRootsScope
213 GenCollectedHeap::SO_None,
214 ClassUnloading,
215 &follow_root_closure,
216 &follow_root_closure,
217 &follow_cld_closure);
218
219 // Process reference objects found during marking
220 {
221 ref_processor()->setup_policy(clear_all_softrefs);
222 const ReferenceProcessorStats& stats =
223 ref_processor()->process_discovered_references(
224 &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer, _gc_tracer->gc_id());
225 gc_tracer()->report_gc_reference_stats(stats);
226 }
227
228 // This is the point where the entire marking should have completed.
229 assert(_marking_stack.is_empty(), "Marking should have completed");
230
231 // Unload classes and purge the SystemDictionary.
232 bool purged_class = SystemDictionary::do_unloading(&is_alive);
233
234 // Unload nmethods.
|