218 template <typename ITR>
219 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops) {
220 CLDToOopClosure clds_cl(oops, ClassLoaderData::_claim_strong);
221 MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations);
222 strong_roots_do(worker_id, oops, &clds_cl, &blobs_cl);
223 }
224
225 template <typename ITR>
226 void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure *tc) {
227 assert(!ShenandoahSafepoint::is_at_shenandoah_safepoint() ||
228 !ShenandoahHeap::heap()->unload_classes(),
229 "Expect class unloading when Shenandoah cycle is running");
230 ResourceMark rm;
231
232 _serial_roots.oops_do(oops, worker_id);
233 _vm_roots.oops_do(oops, worker_id);
234
235 assert(clds != NULL, "Only possible with CLD closure");
236 _cld_roots.cld_do(clds, worker_id);
237
238 // With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
239 // and instead do that in concurrent phase under the relevant lock. This saves init mark
240 // pause time.
241 if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
242 _code_roots.code_blobs_do(code, worker_id);
243 ShenandoahParallelOopsDoThreadClosure tc_cl(oops, NULL, tc);
244 _thread_roots.threads_do(&tc_cl, worker_id);
245 } else {
246 ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
247 _thread_roots.threads_do(&tc_cl, worker_id);
248 }
249
250 AlwaysTrueClosure always_true;
251 _dedup_roots.oops_do(&always_true, oops, worker_id);
252 }
253
254 template <typename ITR>
255 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) {
256 assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
257 ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
258 ResourceMark rm;
259
260 _serial_roots.oops_do(oops, worker_id);
261 _vm_roots.oops_do(oops, worker_id);
262 _cld_roots.always_strong_cld_do(clds, worker_id);
263 _thread_roots.threads_do(&tc_cl, worker_id);
264 }
265
266 template <typename IsAlive, typename KeepAlive>
267 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
268 CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
|
218 template <typename ITR>
219 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops) {
220 CLDToOopClosure clds_cl(oops, ClassLoaderData::_claim_strong);
221 MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations);
222 strong_roots_do(worker_id, oops, &clds_cl, &blobs_cl);
223 }
224
225 template <typename ITR>
226 void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure *tc) {
227 assert(!ShenandoahSafepoint::is_at_shenandoah_safepoint() ||
228 !ShenandoahHeap::heap()->unload_classes(),
229 "Expect class unloading when Shenandoah cycle is running");
230 ResourceMark rm;
231
232 _serial_roots.oops_do(oops, worker_id);
233 _vm_roots.oops_do(oops, worker_id);
234
235 assert(clds != NULL, "Only possible with CLD closure");
236 _cld_roots.cld_do(clds, worker_id);
237
238 ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
239 _thread_roots.threads_do(&tc_cl, worker_id);
240
241 AlwaysTrueClosure always_true;
242 _dedup_roots.oops_do(&always_true, oops, worker_id);
243 }
244
245 template <typename ITR>
246 void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) {
247 assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
248 ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
249 ResourceMark rm;
250
251 _serial_roots.oops_do(oops, worker_id);
252 _vm_roots.oops_do(oops, worker_id);
253 _cld_roots.always_strong_cld_do(clds, worker_id);
254 _thread_roots.threads_do(&tc_cl, worker_id);
255 }
256
257 template <typename IsAlive, typename KeepAlive>
258 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
259 CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
|