< prev index next >

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

Print this page
rev 8463 : Support for -Xnoclassgc
rev 8465 : Support for -Xnoclassgc

@@ -88,22 +88,22 @@
   }
 };
 
 
 void G1RootProcessor::worker_has_discovered_all_strong_classes() {
-  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+  assert(ClassUnloading && ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 
   uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
   if (new_value == n_workers()) {
     // This thread is last. Notify the others.
     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
     _lock.notify_all();
   }
 }
 
 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
-  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+  assert(ClassUnloading && ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 
   if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
     while ((uint)_n_workers_discovered_strong_classes != n_workers()) {
       _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);

@@ -209,11 +209,11 @@
 
 void G1RootProcessor::process_strong_roots(OopClosure* oops,
                                            CLDClosure* clds,
                                            CodeBlobClosure* blobs) {
 
-  process_java_roots(oops, clds, clds, NULL, blobs, NULL, 0);
+  process_java_roots(oops, clds, clds, ClassUnloading ? NULL : clds, blobs, NULL, 0);
   process_vm_roots(oops, NULL, NULL, 0);
 
   _process_strong_tasks->all_tasks_completed(n_workers());
 }
 

@@ -236,11 +236,11 @@
                                          CLDClosure* strong_clds,
                                          CLDClosure* weak_clds,
                                          CodeBlobClosure* strong_code,
                                          G1GCPhaseTimes* phase_times,
                                          uint worker_i) {
-  assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
+  assert(thread_stack_clds == NULL || weak_clds == NULL || !ClassUnloading, "There is overlap between those, only one may be set");
   // Iterating over the CLDG and the Threads are done early to allow us to
   // first process the strong CLDs and nmethods and then, after a barrier,
   // let the thread process the weak CLDs and nmethods.
   {
     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
< prev index next >