changeset 4918:4923cab3640c

8023145: G1: G1CollectedHeap::mark_strong_code_roots() needs to handle ParallelGCThreads=0 Reviewed-by: stefank, mgerdin
author brutisso
date Thu, 19 Dec 2013 09:22:30 +0100
parents 0114a0a4434c
children 03ecf4784ddd
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	Wed Jan 22 13:28:27 2014 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Dec 19 09:22:30 2013 +0100
@@ -6813,10 +6813,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 {