src/hotspot/share/gc/shared/gcArguments.cpp
changeset 53116 bb03098c4dde
parent 49710 f67333fc42bd
child 53119 375b10185c40
equal deleted inserted replaced
53115:b5c41404f2d1 53116:bb03098c4dde
    26 #include "precompiled.hpp"
    26 #include "precompiled.hpp"
    27 #include "gc/shared/gcArguments.hpp"
    27 #include "gc/shared/gcArguments.hpp"
    28 #include "runtime/arguments.hpp"
    28 #include "runtime/arguments.hpp"
    29 #include "runtime/globals.hpp"
    29 #include "runtime/globals.hpp"
    30 #include "runtime/globals_extension.hpp"
    30 #include "runtime/globals_extension.hpp"
       
    31 #include "utilities/defaultStream.hpp"
    31 #include "utilities/macros.hpp"
    32 #include "utilities/macros.hpp"
    32 
    33 
    33 void GCArguments::initialize() {
    34 void GCArguments::initialize() {
    34   if (FullGCALot && FLAG_IS_DEFAULT(MarkSweepAlwaysCompactCount)) {
    35   if (FullGCALot && FLAG_IS_DEFAULT(MarkSweepAlwaysCompactCount)) {
    35     MarkSweepAlwaysCompactCount = 1;  // Move objects every gc.
    36     MarkSweepAlwaysCompactCount = 1;  // Move objects every gc.
    51 
    52 
    52   if (!ClassUnloading) {
    53   if (!ClassUnloading) {
    53     // If class unloading is disabled, also disable concurrent class unloading.
    54     // If class unloading is disabled, also disable concurrent class unloading.
    54     FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
    55     FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
    55   }
    56   }
       
    57 
       
    58   if (!FLAG_IS_DEFAULT(AllocateOldGenAt)) {
       
    59     // CompressedOops not supported when AllocateOldGenAt is set.
       
    60     FLAG_SET_DEFAULT(UseCompressedOops, false);
       
    61     FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
       
    62     // When AllocateOldGenAt is set, we cannot use largepages for entire heap memory.
       
    63     // Only young gen which is allocated in dram can use large pages, but we currently don't support that.
       
    64     FLAG_SET_DEFAULT(UseLargePages, false);
       
    65   }
    56 }
    66 }
       
    67 
       
    68 bool GCArguments::check_args_consistency() {
       
    69   bool status = true;
       
    70   if (!FLAG_IS_DEFAULT(AllocateHeapAt) && !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
       
    71     jio_fprintf(defaultStream::error_stream(),
       
    72       "AllocateHeapAt and AllocateOldGenAt cannot be used together.\n");
       
    73     status = false;
       
    74   }
       
    75   if (!FLAG_IS_DEFAULT(AllocateOldGenAt) && (UseSerialGC || UseConcMarkSweepGC || UseEpsilonGC || UseZGC)) {
       
    76     jio_fprintf(defaultStream::error_stream(),
       
    77       "AllocateOldGenAt is not supported for selected GC.\n");
       
    78     status = false;
       
    79   }
       
    80   return status;
       
    81 }