8023145: G1: G1CollectedHeap::mark_strong_code_roots() needs to handle ParallelGCThreads=0
authorbrutisso
Fri, 16 Aug 2013 11:26:09 +0200
changeset 19341 17284e84baba
parent 19340 f62b3c74b50f
child 19342 f3957eba8935
child 19344 472c5665efeb
8023145: G1: G1CollectedHeap::mark_strong_code_roots() needs to handle ParallelGCThreads=0 Reviewed-by: stefank, mgerdin
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Aug 15 13:02:42 2013 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Aug 16 11:26:09 2013 +0200
@@ -6807,10 +6807,14 @@
 
 void G1CollectedHeap::mark_strong_code_roots(uint worker_id) {
   MarkStrongCodeRootsHRClosure cl(this, worker_id);
-  heap_region_par_iterate_chunked(&cl,
-                                  worker_id,
-                                  workers()->active_workers(),
-                                  HeapRegion::ParMarkRootClaimValue);
+  if (G1CollectedHeap::use_parallel_gc_threads()) {
+    heap_region_par_iterate_chunked(&cl,
+                                    worker_id,
+                                    workers()->active_workers(),
+                                    HeapRegion::ParMarkRootClaimValue);
+  } else {
+    heap_region_iterate(&cl);
+  }
 }
 
 class RebuildStrongCodeRootClosure: public CodeBlobClosure {