src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp
changeset 55335 f7cc25dda38a
parent 55121 f19a728d576d
child 55395 9c6d907cefac
equal deleted inserted replaced
55334:ff74a3c584e5 55335:f7cc25dda38a
    97           "Expect class unloading or traversal when Shenandoah cycle is running");
    97           "Expect class unloading or traversal when Shenandoah cycle is running");
    98   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
    98   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
    99   ResourceMark rm;
    99   ResourceMark rm;
   100 
   100 
   101   _serial_roots.oops_do(oops, worker_id);
   101   _serial_roots.oops_do(oops, worker_id);
       
   102   _jni_roots.oops_do(oops, worker_id);
   102   _cld_roots.clds_do(clds, clds, worker_id);
   103   _cld_roots.clds_do(clds, clds, worker_id);
   103   _thread_roots.threads_do(&tc_cl, worker_id);
   104   _thread_roots.threads_do(&tc_cl, worker_id);
   104 
   105 
   105   // With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
   106   // With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
   106   // and instead do that in concurrent phase under the relevant lock. This saves init mark
   107   // and instead do that in concurrent phase under the relevant lock. This saves init mark
   116   MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations);
   117   MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations);
   117   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
   118   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
   118   ResourceMark rm;
   119   ResourceMark rm;
   119 
   120 
   120   _serial_roots.oops_do(oops, 0);
   121   _serial_roots.oops_do(oops, 0);
       
   122   _jni_roots.oops_do(oops, 0);
   121   _cld_roots.clds_do(&clds, &clds, 0);
   123   _cld_roots.clds_do(&clds, &clds, 0);
   122   _thread_roots.threads_do(&tc_cl, 0);
   124   _thread_roots.threads_do(&tc_cl, 0);
   123   _code_roots.code_blobs_do(&code, 0);
   125   _code_roots.code_blobs_do(&code, 0);
   124 }
   126 }
   125 
   127 
   128   assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
   130   assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
   129   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
   131   ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
   130   ResourceMark rm;
   132   ResourceMark rm;
   131 
   133 
   132   _serial_roots.oops_do(oops, worker_id);
   134   _serial_roots.oops_do(oops, worker_id);
       
   135   _jni_roots.oops_do(oops, worker_id);
   133   _cld_roots.clds_do(clds, NULL, worker_id);
   136   _cld_roots.clds_do(clds, NULL, worker_id);
   134   _thread_roots.threads_do(&tc_cl, worker_id);
   137   _thread_roots.threads_do(&tc_cl, worker_id);
   135 }
   138 }
   136 
   139 
   137 template <typename IsAlive, typename KeepAlive>
   140 template <typename IsAlive, typename KeepAlive>
   139   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
   142   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
   140   CLDToOopClosure clds(keep_alive, ClassLoaderData::_claim_strong);
   143   CLDToOopClosure clds(keep_alive, ClassLoaderData::_claim_strong);
   141   CLDToOopClosure* weak_clds = ShenandoahHeap::heap()->unload_classes() ? NULL : &clds;
   144   CLDToOopClosure* weak_clds = ShenandoahHeap::heap()->unload_classes() ? NULL : &clds;
   142 
   145 
   143   _serial_roots.oops_do(keep_alive, worker_id);
   146   _serial_roots.oops_do(keep_alive, worker_id);
       
   147   _jni_roots.oops_do(keep_alive, worker_id);
   144 
   148 
   145   _thread_roots.oops_do(keep_alive, NULL, worker_id);
   149   _thread_roots.oops_do(keep_alive, NULL, worker_id);
   146   _cld_roots.clds_do(&clds, weak_clds, worker_id);
   150   _cld_roots.clds_do(&clds, weak_clds, worker_id);
   147 
   151 
   148   if(_update_code_cache) {
   152   if(_update_code_cache) {