src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp
changeset 59296 9186be5c78ba
parent 57995 d8f22418ca99
equal deleted inserted replaced
59295:8b6cc0bb93d0 59296:9186be5c78ba
    30   // Don't support traversal GC at this moment
    30   // Don't support traversal GC at this moment
    31   return !ShenandoahHeap::heap()->is_traversal_mode();
    31   return !ShenandoahHeap::heap()->is_traversal_mode();
    32 }
    32 }
    33 
    33 
    34 bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
    34 bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
    35   ShenandoahHeap* const heap = ShenandoahHeap::heap();
       
    36   bool stw_gc_in_progress = heap->is_full_gc_in_progress() ||
       
    37                             heap->is_degenerated_gc_in_progress();
       
    38   return can_do_concurrent_roots() &&
    35   return can_do_concurrent_roots() &&
    39          !stw_gc_in_progress;
    36          !ShenandoahHeap::heap()->is_stw_gc_in_progress();
    40 }
    37 }
       
    38 
       
    39 bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
       
    40 #if defined(X86) && !defined(SOLARIS)
       
    41   return ShenandoahCodeRootsStyle == 2 &&
       
    42          ClassUnloading &&
       
    43          strcmp(ShenandoahGCMode, "traversal") != 0;
       
    44 #else
       
    45   return false;
       
    46 #endif
       
    47 }
       
    48 
       
    49 bool ShenandoahConcurrentRoots::should_do_concurrent_class_unloading() {
       
    50   return can_do_concurrent_class_unloading() &&
       
    51          !ShenandoahHeap::heap()->is_stw_gc_in_progress();
       
    52 }