diff -r 8b6cc0bb93d0 -r 9186be5c78ba src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp Wed Nov 27 06:36:41 2019 -0800 +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp Wed Nov 27 11:52:57 2019 -0500 @@ -32,6 +32,7 @@ #include "gc/shenandoah/shenandoahLock.hpp" #include "gc/shenandoah/shenandoahEvacOOMHandler.hpp" #include "gc/shenandoah/shenandoahSharedVariables.hpp" +#include "gc/shenandoah/shenandoahUnload.hpp" #include "services/memoryManager.hpp" class ConcurrentGCTimer; @@ -271,6 +272,7 @@ ShenandoahSharedFlag _full_gc_in_progress; ShenandoahSharedFlag _full_gc_move_in_progress; ShenandoahSharedFlag _progress_last_gc; + ShenandoahSharedFlag _concurrent_root_in_progress; void set_gc_state_all_threads(char state); void set_gc_state_mask(uint mask, bool value); @@ -287,6 +289,7 @@ void set_full_gc_move_in_progress(bool in_progress); void set_concurrent_traversal_in_progress(bool in_progress); void set_has_forwarded_objects(bool cond); + void set_concurrent_root_in_progress(bool cond); inline bool is_stable() const; inline bool is_idle() const; @@ -299,6 +302,8 @@ inline bool is_concurrent_traversal_in_progress() const; inline bool has_forwarded_objects() const; inline bool is_gc_in_progress_mask(uint mask) const; + inline bool is_stw_gc_in_progress() const; + inline bool is_concurrent_root_in_progress() const; // ---------- GC cancellation and degeneration machinery // @@ -511,6 +516,7 @@ // private: ShenandoahSharedFlag _unload_classes; + ShenandoahUnload _unloader; public: void set_unload_classes(bool uc); @@ -523,6 +529,12 @@ void stw_unload_classes(bool full_gc); void stw_process_weak_roots(bool full_gc); + // Prepare concurrent root processing + void prepare_concurrent_roots(); + // Prepare and finish concurrent unloading + void prepare_concurrent_unloading(); + void finish_concurrent_unloading(); + // ---------- Generic interface hooks // Minor things that super-interface expects us to implement to play nice with // the rest of runtime. Some of the things here are not required to be implemented, @@ -562,7 +574,7 @@ public: void register_nmethod(nmethod* nm); void unregister_nmethod(nmethod* nm); - void flush_nmethod(nmethod* nm) {} + void flush_nmethod(nmethod* nm); void verify_nmethod(nmethod* nm) {} // ---------- Pinning hooks