--- old/src/share/vm/gc/g1/g1RootProcessor.cpp 2015-06-06 02:21:44.000000000 +0200 +++ new/src/share/vm/gc/g1/g1RootProcessor.cpp 2015-06-06 02:21:44.000000000 +0200 @@ -90,7 +90,7 @@ 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()) { @@ -101,7 +101,7 @@ } 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); @@ -211,7 +211,7 @@ 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()); @@ -238,7 +238,7 @@ 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.