8049421: G1 Class Unloading after completing a concurrent mark cycle

Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Reviewed-by: tschatzl, ehelin, brutisso, coleenp, roland, iveresov
This commit is contained in:
Stefan Karlsson 2014-07-07 10:12:40 +02:00
parent ef1e9b3c80
commit 1b001a2afd
75 changed files with 2169 additions and 874 deletions

View file

@ -129,13 +129,15 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
SharedHeap* sh = SharedHeap::heap();
// Need cleared claim bits for the strong roots processing
// Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
sh->process_strong_roots(true, // activate StrongRootsScope
SharedHeap::SO_SystemClasses,
MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
sh->process_strong_roots(true, // activate StrongRootsScope
SharedHeap::SO_None,
&GenMarkSweep::follow_root_closure,
&GenMarkSweep::follow_klass_closure);
&GenMarkSweep::follow_cld_closure,
&follow_code_closure);
// Process reference objects found during marking
ReferenceProcessor* rp = GenMarkSweep::ref_processor();
@ -304,13 +306,15 @@ void G1MarkSweep::mark_sweep_phase3() {
SharedHeap* sh = SharedHeap::heap();
// Need cleared claim bits for the strong roots processing
// Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
sh->process_strong_roots(true, // activate StrongRootsScope
SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache,
&GenMarkSweep::adjust_pointer_closure,
&GenMarkSweep::adjust_klass_closure);
CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
sh->process_all_roots(true, // activate StrongRootsScope
SharedHeap::SO_AllCodeCache,
&GenMarkSweep::adjust_pointer_closure,
&GenMarkSweep::adjust_cld_closure,
&adjust_code_closure);
assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);