< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp

Print this page
*** 23,133 ***
   */
  
  #include "precompiled.hpp"
  
  #include "gc/shared/gc_globals.hpp"
- #include "gc/shared/workerPolicy.hpp"
  #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
- #include "runtime/javaThread.hpp"
- #include "runtime/threads.hpp"
- 
- uint ShenandoahWorkerPolicy::_prev_par_marking     = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_marking    = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_evac       = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_root_proc  = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_refs_proc  = 0;
- uint ShenandoahWorkerPolicy::_prev_fullgc          = 0;
- uint ShenandoahWorkerPolicy::_prev_degengc         = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0;
- uint ShenandoahWorkerPolicy::_prev_par_update_ref  = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_cleanup    = 0;
- uint ShenandoahWorkerPolicy::_prev_conc_reset      = 0;
  
  uint ShenandoahWorkerPolicy::calc_workers_for_init_marking() {
!   uint active_workers = (_prev_par_marking == 0) ? ParallelGCThreads : _prev_par_marking;
- 
-   _prev_par_marking =
-     WorkerPolicy::calc_active_workers(ParallelGCThreads,
-                                       active_workers,
-                                       Threads::number_of_non_daemon_threads());
-   return _prev_par_marking;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_marking() {
!   uint active_workers = (_prev_conc_marking == 0) ?  ConcGCThreads : _prev_conc_marking;
!   _prev_conc_marking =
!     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
!                                            active_workers,
!                                            Threads::number_of_non_daemon_threads());
-   return _prev_conc_marking;
  }
  
- // Reuse the calculation result from init marking
  uint ShenandoahWorkerPolicy::calc_workers_for_final_marking() {
!   return _prev_par_marking;
  }
  
- // Calculate workers for concurrent refs processing
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing() {
!   uint active_workers = (_prev_conc_refs_proc == 0) ? ConcGCThreads : _prev_conc_refs_proc;
-   _prev_conc_refs_proc =
-     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                            active_workers,
-                                            Threads::number_of_non_daemon_threads());
-   return _prev_conc_refs_proc;
  }
  
- // Calculate workers for concurrent root processing
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing() {
!   uint active_workers = (_prev_conc_root_proc == 0) ? ConcGCThreads : _prev_conc_root_proc;
-   _prev_conc_root_proc =
-           WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                                  active_workers,
-                                                  Threads::number_of_non_daemon_threads());
-   return _prev_conc_root_proc;
  }
  
- // Calculate workers for concurrent evacuation (concurrent GC)
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_evac() {
!   uint active_workers = (_prev_conc_evac == 0) ? ConcGCThreads : _prev_conc_evac;
-   _prev_conc_evac =
-     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                            active_workers,
-                                            Threads::number_of_non_daemon_threads());
-   return _prev_conc_evac;
  }
  
- // Calculate workers for parallel fullgc
  uint ShenandoahWorkerPolicy::calc_workers_for_fullgc() {
!   uint active_workers = (_prev_fullgc == 0) ?  ParallelGCThreads : _prev_fullgc;
-   _prev_fullgc =
-     WorkerPolicy::calc_active_workers(ParallelGCThreads,
-                                       active_workers,
-                                       Threads::number_of_non_daemon_threads());
-   return _prev_fullgc;
  }
  
- // Calculate workers for parallel degenerated gc
  uint ShenandoahWorkerPolicy::calc_workers_for_stw_degenerated() {
!   uint active_workers = (_prev_degengc == 0) ?  ParallelGCThreads : _prev_degengc;
-   _prev_degengc =
-     WorkerPolicy::calc_active_workers(ParallelGCThreads,
-                                       active_workers,
-                                       Threads::number_of_non_daemon_threads());
-   return _prev_degengc;
  }
  
- // Calculate workers for concurrent reference update
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_update_ref() {
!   uint active_workers = (_prev_conc_update_ref == 0) ? ConcGCThreads : _prev_conc_update_ref;
-   _prev_conc_update_ref =
-     WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                            active_workers,
-                                            Threads::number_of_non_daemon_threads());
-   return _prev_conc_update_ref;
  }
  
- // Calculate workers for parallel reference update
  uint ShenandoahWorkerPolicy::calc_workers_for_final_update_ref() {
!   uint active_workers = (_prev_par_update_ref == 0) ? ParallelGCThreads : _prev_par_update_ref;
-   _prev_par_update_ref =
-     WorkerPolicy::calc_active_workers(ParallelGCThreads,
-                                       active_workers,
-                                       Threads::number_of_non_daemon_threads());
-   return _prev_par_update_ref;
- }
- 
- uint ShenandoahWorkerPolicy::calc_workers_for_conc_cleanup() {
-   uint active_workers = (_prev_conc_cleanup == 0) ? ConcGCThreads : _prev_conc_cleanup;
-   _prev_conc_cleanup =
-           WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                                  active_workers,
-                                                  Threads::number_of_non_daemon_threads());
-   return _prev_conc_cleanup;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_reset() {
!   uint active_workers = (_prev_conc_reset == 0) ? ConcGCThreads : _prev_conc_reset;
-   _prev_conc_reset =
-           WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
-                                                  active_workers,
-                                                  Threads::number_of_non_daemon_threads());
-   return _prev_conc_reset;
  }
--- 23,54 ---
   */
  
  #include "precompiled.hpp"
  
  #include "gc/shared/gc_globals.hpp"
  #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
  
  uint ShenandoahWorkerPolicy::calc_workers_for_init_marking() {
!   return ParallelGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_marking() {
!   return ConcGCThreads;
! }
! 
! uint ShenandoahWorkerPolicy::calc_workers_for_rs_scanning() {
!   return ConcGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_final_marking() {
!   return ParallelGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing() {
!   return ConcGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing() {
!   return ConcGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_evac() {
!   return ConcGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_fullgc() {
!   return ParallelGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_stw_degenerated() {
!   return ParallelGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_update_ref() {
!   return ConcGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_final_update_ref() {
!   return ParallelGCThreads;
  }
  
  uint ShenandoahWorkerPolicy::calc_workers_for_conc_reset() {
!   return ConcGCThreads;
  }
< prev index next >