# HG changeset patch # User Gilles Duboscq # Date 1452264415 -3600 # Node ID bd88fd590f4e31f8f7d6e0d0a02f84613554b3a7 # Parent dd9cc155639c8f31381d2fd6cfab0610d734d68b Restore G1 changes from e13c65f874e5 after merge diff -r dd9cc155639c -r bd88fd590f4e src/share/vm/gc_implementation/g1/g1RootProcessor.cpp --- 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);