changeset 23287:bd88fd590f4e

Restore G1 changes from e13c65f874e5 after merge
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Fri, 08 Jan 2016 15:46:55 +0100
parents dd9cc155639c
children d2cd0b15957c
files src/share/vm/gc_implementation/g1/g1RootProcessor.cpp
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp	Thu Jan 07 17:28:46 2016 +0100
+++ b/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp	Fri Jan 08 15:46:55 2016 +0100
@@ -138,6 +138,13 @@
   OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
   OopClosure* const strong_roots = &buf_scan_non_heap_roots;
 
+  bool trace_codecache = false;
+#if INCLUDE_JVMCI
+  bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
+  // Without eager nmethod unloading, we need to treat all oops in code cache as strong during the initial mark
+  trace_codecache = during_im && !ClassUnloadingWithConcurrentMark;
+#endif
+
   // CodeBlobClosures are not interoperable with BufferingOopClosures
   G1CodeBlobClosure root_code_blobs(scan_non_heap_roots);
 
@@ -145,7 +152,7 @@
                      trace_metadata ? scan_strong_clds : NULL,
                      scan_strong_clds,
                      trace_metadata ? NULL : scan_weak_clds,
-                     &root_code_blobs,
+                     trace_codecache ? NULL : &root_code_blobs,
                      phase_times,
                      worker_i);
 
@@ -157,6 +164,12 @@
 
   process_vm_roots(strong_roots, weak_roots, phase_times, worker_i);
 
+#if INCLUDE_JVMCI
+  if (trace_codecache && !_process_strong_tasks->is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
+    CodeCache::blobs_do(&root_code_blobs);
+  }
+#endif
+
   {
     // Now the CM ref_processor roots.
     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);