< prev index next >

src/share/vm/gc/g1/g1MarkSweep.cpp

Print this page
rev 11873 : imported patch 8114823-disable-cls-unload
rev 11874 : 8114823: G1 doesn't honor request to disable class unloading
Reviewed-by:

@@ -130,13 +130,20 @@
   ClassLoaderDataGraph::clear_claimed_marks();
 
   MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
   {
     G1RootProcessor root_processor(g1h, 1);
+    if (ClassUnloading) {
     root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
                                         &GenMarkSweep::follow_cld_closure,
                                         &follow_code_closure);
+    } else {
+      root_processor.process_all_roots_no_string_table(
+                                          &GenMarkSweep::follow_root_closure,
+                                          &GenMarkSweep::follow_cld_closure,
+                                          &follow_code_closure);
+    }
   }
 
   {
     GCTraceTime(Debug, gc, phases) trace("Reference Processing", gc_timer());
 

@@ -155,11 +162,11 @@
   }
 
   // This is the point where the entire marking should have completed.
   assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
 
-  {
+  if (ClassUnloading) {
     GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer());
 
     // Unload classes and purge the SystemDictionary.
     bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
 
< prev index next >