317 }
318 }
319
320 void ShenandoahConcurrentMark::init_mark_roots() {
321 assert(Thread::current()->is_VM_thread(), "can only do this in VMThread");
322 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
323
324 mark_roots(ShenandoahPhaseTimings::scan_roots);
325 }
326
327 void ShenandoahConcurrentMark::update_roots(ShenandoahPhaseTimings::Phase root_phase) {
328 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
329
330 bool update_code_cache = true; // initialize to safer value
331 switch (root_phase) {
332 case ShenandoahPhaseTimings::update_roots:
333 case ShenandoahPhaseTimings::final_update_refs_roots:
334 update_code_cache = false;
335 break;
336 case ShenandoahPhaseTimings::full_gc_roots:
337 update_code_cache = true;
338 break;
339 default:
340 ShouldNotReachHere();
341 }
342
343 ShenandoahHeap* heap = ShenandoahHeap::heap();
344
345 ShenandoahGCPhase phase(root_phase);
346
347 #if defined(COMPILER2) || INCLUDE_JVMCI
348 DerivedPointerTable::clear();
349 #endif
350
351 uint nworkers = heap->workers()->active_workers();
352
353 ShenandoahRootProcessor root_proc(heap, nworkers, root_phase);
354 ShenandoahUpdateRootsTask update_roots(&root_proc, update_code_cache);
355 heap->workers()->run_task(&update_roots);
356
|
317 }
318 }
319
320 void ShenandoahConcurrentMark::init_mark_roots() {
321 assert(Thread::current()->is_VM_thread(), "can only do this in VMThread");
322 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
323
324 mark_roots(ShenandoahPhaseTimings::scan_roots);
325 }
326
327 void ShenandoahConcurrentMark::update_roots(ShenandoahPhaseTimings::Phase root_phase) {
328 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
329
330 bool update_code_cache = true; // initialize to safer value
331 switch (root_phase) {
332 case ShenandoahPhaseTimings::update_roots:
333 case ShenandoahPhaseTimings::final_update_refs_roots:
334 update_code_cache = false;
335 break;
336 case ShenandoahPhaseTimings::full_gc_roots:
337 case ShenandoahPhaseTimings::degen_gc_update_roots:
338 update_code_cache = true;
339 break;
340 default:
341 ShouldNotReachHere();
342 }
343
344 ShenandoahHeap* heap = ShenandoahHeap::heap();
345
346 ShenandoahGCPhase phase(root_phase);
347
348 #if defined(COMPILER2) || INCLUDE_JVMCI
349 DerivedPointerTable::clear();
350 #endif
351
352 uint nworkers = heap->workers()->active_workers();
353
354 ShenandoahRootProcessor root_proc(heap, nworkers, root_phase);
355 ShenandoahUpdateRootsTask update_roots(&root_proc, update_code_cache);
356 heap->workers()->run_task(&update_roots);
357
|