diff src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 21143:e13c65f874e5

Make G1 and Graal be friends in JDK9
author iveresov
date Tue, 28 Apr 2015 17:08:47 -0700
parents d3cec14f33f3
children
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Apr 28 12:58:40 2015 -0700
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Apr 28 17:08:47 2015 -0700
@@ -4830,11 +4830,14 @@
   bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
   bool trace_metadata = during_im && ClassUnloadingWithConcurrentMark;
 
+  // Without eager nmethod unloading, we need to treat all oops in code cache as strong during the initial mark
+  bool trace_codecache = during_im && !ClassUnloadingWithConcurrentMark;
+
   BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
   BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
 
   process_roots(false, // no scoping; this is parallel code
-                SharedHeap::SO_None,
+                trace_codecache ? SharedHeap::SO_AllCodeCache : SharedHeap::SO_None,
                 &buf_scan_non_heap_roots,
                 &buf_scan_non_heap_weak_roots,
                 scan_strong_clds,