changeset 10940:d85bdcb38fa2

Apply patch by Mikael Gerdin which fixes filtered strong marking of nmethods
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Fri, 02 Aug 2013 13:35:13 +0200
parents f22cbff51c12
children b9718191858c
files src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Aug 02 13:31:31 2013 +0200
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Aug 02 13:35:13 2013 +0200
@@ -5127,12 +5127,20 @@
 
   // Walk the code cache w/o buffering, because StarTask cannot handle
   // unaligned oop locations.
-  G1FilteredCodeBlobToOopClosure eager_scan_code_roots(this, scan_non_heap_roots);
+  G1FilteredCodeBlobToOopClosure eager_scan_cs_code_roots(this, scan_non_heap_roots);
+
+  // Scan all code roots from stack
+  CodeBlobToOopClosure eager_scan_all_code_roots(scan_non_heap_roots, true);
+  CodeBlobToOopClosure* blobs = &eager_scan_cs_code_roots;
+  if (UseNewCode && g1_policy()->during_initial_mark_pause()) {
+    // during initial-mark we need to take care to follow all code roots
+    blobs = &eager_scan_all_code_roots;
+  }
 
   process_strong_roots(false, // no scoping; this is parallel code
                        is_scavenging, so,
                        &buf_scan_non_heap_roots,
-                       &eager_scan_code_roots,
+                       blobs,
                        scan_klasses
                        );