< prev index next >

src/share/vm/memory/defNewGeneration.cpp

Print this page

        

@@ -37,10 +37,11 @@
 #include "memory/genRemSet.hpp"
 #include "memory/generationSpec.hpp"
 #include "memory/iterator.hpp"
 #include "memory/referencePolicy.hpp"
 #include "memory/space.inline.hpp"
+#include "memory/strongRootsScope.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/prefetch.inline.hpp"

@@ -623,19 +624,24 @@
                                                   &fsc_with_gc_barrier);
 
   assert(gch->no_allocs_since_save_marks(0),
          "save marks have not been newly set.");
 
-  gch->gen_process_roots(_level,
+  {
+    // SerialGC runs with n_workers == 0.
+    StrongRootsScope srs(0);
+
+    gch->gen_process_roots(&srs,
+                           _level,
                          true,  // Process younger gens, if any,
                                 // as strong roots.
-                         true,  // activate StrongRootsScope
                          GenCollectedHeap::SO_ScavengeCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &fsc_with_no_gc_barrier,
                          &fsc_with_gc_barrier,
                          &cld_scan_closure);
+  }
 
   // "evacuate followers".
   evacuate_followers.do_void();
 
   FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
< prev index next >