changeset 5115:9720d338b1d5

8023145: G1: G1CollectedHeap::mark_strong_code_roots() needs to handle ParallelGCThreads=0 Reviewed-by: stefank, mgerdin
author brutisso
date Fri, 16 Aug 2013 11:26:09 +0200
parents 8088d93a63e6
children d0afbee540e0 57600c4aeabe
files src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Aug 15 13:02:42 2013 -0700
+++ b/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 {