< prev index next >

src/hotspot/share/gc/shared/gcConfiguration.cpp

Print this page

 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 #include "precompiled.hpp"
 25 #include "gc/shared/collectedHeap.hpp"
 26 #include "gc/shared/gc_globals.hpp"
 27 #include "gc/shared/gcArguments.hpp"
 28 #include "gc/shared/gcConfiguration.hpp"
 29 #include "gc/shared/tlab_globals.hpp"
 30 #include "memory/universe.hpp"
 31 #include "oops/compressedOops.hpp"
 32 #include "runtime/globals.hpp"
 33 #include "runtime/globals_extension.hpp"
 34 #include "utilities/debug.hpp"

 35 
 36 GCName GCConfiguration::young_collector() const {
 37   if (UseG1GC) {
 38     return G1New;
 39   }
 40 
 41   if (UseParallelGC) {
 42     return ParallelScavenge;
 43   }
 44 









 45   if (UseZGC) {
 46     if (ZGenerational) {
 47       return ZMinor;
 48     } else {
 49       return NA;
 50     }
 51   }
 52 
 53   if (UseShenandoahGC) {
 54     return NA;
 55   }
 56 
 57   return DefNew;
 58 }
 59 
 60 GCName GCConfiguration::old_collector() const {
 61   if (UseG1GC) {
 62     return G1Old;
 63   }
 64 
 65   if (UseParallelGC) {
 66     return ParallelOld;
 67   }
 68 









 69   if (UseZGC) {
 70     if (ZGenerational) {
 71       return ZMajor;
 72     } else {
 73       return Z;
 74     }
 75   }
 76 
 77   if (UseShenandoahGC) {
 78     return Shenandoah;
 79   }
 80 
 81   return SerialOld;
 82 }
 83 
 84 uint GCConfiguration::num_parallel_gc_threads() const {
 85   return ParallelGCThreads;
 86 }
 87 
 88 uint GCConfiguration::num_concurrent_gc_threads() const {
 89   return ConcGCThreads;
 90 }
 91 
 92 bool GCConfiguration::uses_dynamic_gc_threads() const {
 93   return UseDynamicNumberOfGCThreads;
 94 }
 95 
 96 bool GCConfiguration::is_explicit_gc_concurrent() const {
 97   return ExplicitGCInvokesConcurrent;
 98 }
 99 
100 bool GCConfiguration::is_explicit_gc_disabled() const {

 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 #include "precompiled.hpp"
 25 #include "gc/shared/collectedHeap.hpp"
 26 #include "gc/shared/gc_globals.hpp"
 27 #include "gc/shared/gcArguments.hpp"
 28 #include "gc/shared/gcConfiguration.hpp"
 29 #include "gc/shared/tlab_globals.hpp"
 30 #include "memory/universe.hpp"
 31 #include "oops/compressedOops.hpp"
 32 #include "runtime/globals.hpp"
 33 #include "runtime/globals_extension.hpp"
 34 #include "utilities/debug.hpp"
 35 #include "utilities/macros.hpp"
 36 
 37 GCName GCConfiguration::young_collector() const {
 38   if (UseG1GC) {
 39     return G1New;
 40   }
 41 
 42   if (UseParallelGC) {
 43     return ParallelScavenge;
 44   }
 45 
 46   if (UseShenandoahGC) {
 47 #if INCLUDE_SHENANDOAHGC
 48     if (strcmp(ShenandoahGCMode, "generational") == 0) {
 49       return Shenandoah;
 50     }
 51 #endif
 52     return NA;
 53   }
 54 
 55   if (UseZGC) {
 56     if (ZGenerational) {
 57       return ZMinor;
 58     } else {
 59       return NA;
 60     }
 61   }





 62   return DefNew;
 63 }
 64 
 65 GCName GCConfiguration::old_collector() const {
 66   if (UseG1GC) {
 67     return G1Old;
 68   }
 69 
 70   if (UseParallelGC) {
 71     return ParallelOld;
 72   }
 73 
 74   if (UseShenandoahGC) {
 75 #if INCLUDE_SHENANDOAHGC
 76     if (strcmp(ShenandoahGCMode, "generational") == 0) {
 77       return Shenandoah;
 78     }
 79 #endif
 80     return NA;
 81   }
 82 
 83   if (UseZGC) {
 84     if (ZGenerational) {
 85       return ZMajor;
 86     } else {
 87       return Z;
 88     }
 89   }





 90   return SerialOld;
 91 }
 92 
 93 uint GCConfiguration::num_parallel_gc_threads() const {
 94   return ParallelGCThreads;
 95 }
 96 
 97 uint GCConfiguration::num_concurrent_gc_threads() const {
 98   return ConcGCThreads;
 99 }
100 
101 bool GCConfiguration::uses_dynamic_gc_threads() const {
102   return UseDynamicNumberOfGCThreads;
103 }
104 
105 bool GCConfiguration::is_explicit_gc_concurrent() const {
106   return ExplicitGCInvokesConcurrent;
107 }
108 
109 bool GCConfiguration::is_explicit_gc_disabled() const {
< prev index next >