< prev index next >

src/share/vm/gc/shenandoah/shenandoahWorkGroup.hpp

Print this page

        

*** 25,66 **** #define SHARE_VM_GC_SHENANDOAH_SHENANDOAH_WORKGROUP_HPP #include "gc/shared/workgroup.hpp" #include "memory/allocation.hpp" class ShenandoahWorkerScope : public StackObj { ! private: uint _n_workers; ! WorkGang* _workers; public: ! ShenandoahWorkerScope(WorkGang* workers, uint nworkers); ~ShenandoahWorkerScope(); }; ! class ShenandoahPushWorkerScope : StackObj { private: uint _n_workers; uint _old_workers; ! WorkGang* _workers; public: ! ShenandoahPushWorkerScope(WorkGang* workers, uint nworkers); ~ShenandoahPushWorkerScope(); }; class ShenandoahWorkGang : public WorkGang { private: bool _initialize_gclab; public: ShenandoahWorkGang(const char* name, uint workers, bool are_GC_task_threads, ! bool are_ConcurrentGC_threads) : ! WorkGang(name, workers, are_GC_task_threads, are_ConcurrentGC_threads), _initialize_gclab(false) { ! } // Create a GC worker and install it into the work gang. // We need to initialize gclab for dynamic allocated workers AbstractGangWorker* install_worker(uint which); --- 25,83 ---- #define SHARE_VM_GC_SHENANDOAH_SHENANDOAH_WORKGROUP_HPP #include "gc/shared/workgroup.hpp" #include "memory/allocation.hpp" + class ShenandoahWorkGang; class ShenandoahWorkerScope : public StackObj { ! protected: uint _n_workers; ! ShenandoahWorkGang* _workers; public: ! ShenandoahWorkerScope(ShenandoahWorkGang* workers, uint nworkers); ~ShenandoahWorkerScope(); }; ! class ShenandoahPushWorkerScope : public StackObj { private: uint _n_workers; uint _old_workers; ! ShenandoahWorkGang* _workers; public: ! ShenandoahPushWorkerScope(ShenandoahWorkGang* workers, uint nworkers); ~ShenandoahPushWorkerScope(); }; + class ShenandoahWorkerSessionScope : public ShenandoahWorkerScope { + public: + enum SessionType { + Parallel, + Concurrent + }; + + private: + bool _with_session; + + public: + ShenandoahWorkerSessionScope(ShenandoahWorkGang* workers, uint nworkers, + SessionType type); + ~ShenandoahWorkerSessionScope(); + }; + + class ShenandoahWorkGang : public WorkGang { + friend class ShenandoahWorkerSessionScope; private: bool _initialize_gclab; public: ShenandoahWorkGang(const char* name, uint workers, bool are_GC_task_threads, ! bool are_ConcurrentGC_threads); // Create a GC worker and install it into the work gang. // We need to initialize gclab for dynamic allocated workers AbstractGangWorker* install_worker(uint which);
*** 72,80 **** assert(_active_workers <= _total_workers, "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers); return _active_workers; } ! void set_initialize_gclab() { assert(!_initialize_gclab, "Can only enable once"); _initialize_gclab = true; } }; #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAH_WORKGROUP_HPP --- 89,115 ---- assert(_active_workers <= _total_workers, "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers); return _active_workers; } ! void set_initialize_gclab() { ! assert(!_initialize_gclab, "Can only enable once"); ! _initialize_gclab = true; ! } ! ! ! bool static allow_session() { ! return (UseSessionForParallelWorkers || UseSessionForConcWorkers); ! } ! ! static void print_stats(); ! ! private: ! // Only via ShenandoahWorkerSessionScope ! void start_session(); ! void end_session(); ! }; + + #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAH_WORKGROUP_HPP
< prev index next >