src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp
author tschatzl
Fri, 29 Nov 2019 10:20:17 +0100
changeset 59321 5775e4825e58
parent 50289 0195ee80e530
permissions -rw-r--r--
8233998: New young regions registered too early in collection set Reviewed-by: sangheki, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     1
/*
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     2
 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     4
 *
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     7
 * published by the Free Software Foundation.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     8
 *
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    13
 * accompanied this code).
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    14
 *
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    18
 *
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    21
 * questions.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    22
 *
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    23
 */
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    24
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    25
#include "precompiled.hpp"
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    26
#include "gc/g1/heapRegionBounds.inline.hpp"
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    27
#include "gc/g1/jvmFlagConstraintsG1.hpp"
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    28
#include "runtime/globals_extension.hpp"
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    29
#include "utilities/globalDefinitions.hpp"
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    30
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    31
JVMFlag::Error G1RSetRegionEntriesConstraintFunc(intx value, bool verbose) {
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    32
  if (!UseG1GC) return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    33
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    34
  // Default value of G1RSetRegionEntries=0 means will be set ergonomically.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    35
  // Minimum value is 1.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    36
  if (FLAG_IS_CMDLINE(G1RSetRegionEntries) && (value < 1)) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    37
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    38
                        "G1RSetRegionEntries (" INTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    39
                        "greater than or equal to 1\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    40
                        value);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    41
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    42
  } else {
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    43
    return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    44
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    45
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    46
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    47
JVMFlag::Error G1RSetSparseRegionEntriesConstraintFunc(intx value, bool verbose) {
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    48
  if (!UseG1GC) return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    49
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    50
  // Default value of G1RSetSparseRegionEntries=0 means will be set ergonomically.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    51
  // Minimum value is 1.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    52
  if (FLAG_IS_CMDLINE(G1RSetSparseRegionEntries) && (value < 1)) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    53
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    54
                        "G1RSetSparseRegionEntries (" INTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    55
                        "greater than or equal to 1\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    56
                        value);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    57
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    58
  } else {
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    59
    return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    60
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    61
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    62
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    63
JVMFlag::Error G1HeapRegionSizeConstraintFunc(size_t value, bool verbose) {
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    64
  if (!UseG1GC) return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    65
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    66
  // Default value of G1HeapRegionSize=0 means will be set ergonomically.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    67
  if (FLAG_IS_CMDLINE(G1HeapRegionSize) && (value < HeapRegionBounds::min_size())) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    68
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    69
                        "G1HeapRegionSize (" SIZE_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    70
                        "greater than or equal to ergonomic heap region minimum size\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    71
                        value);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    72
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    73
  } else {
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    74
    return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    75
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    76
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    77
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    78
JVMFlag::Error G1NewSizePercentConstraintFunc(uintx value, bool verbose) {
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    79
  if (!UseG1GC) return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    80
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    81
  if (value > G1MaxNewSizePercent) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    82
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    83
                        "G1NewSizePercent (" UINTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    84
                        "less than or equal to G1MaxNewSizePercent (" UINTX_FORMAT ")\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    85
                        value, G1MaxNewSizePercent);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    86
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    87
  } else {
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    88
    return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    89
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    90
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    91
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    92
JVMFlag::Error G1MaxNewSizePercentConstraintFunc(uintx value, bool verbose) {
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
    93
  if (!UseG1GC) return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    94
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
    95
  if (value < G1NewSizePercent) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    96
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    97
                        "G1MaxNewSizePercent (" UINTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    98
                        "greater than or equal to G1NewSizePercent (" UINTX_FORMAT ")\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
    99
                        value, G1NewSizePercent);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   100
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   101
  } else {
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   102
    return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   103
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   104
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   105
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   106
JVMFlag::Error MaxGCPauseMillisConstraintFuncG1(uintx value, bool verbose) {
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   107
  if (UseG1GC && FLAG_IS_CMDLINE(MaxGCPauseMillis) && (value >= GCPauseIntervalMillis)) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   108
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   109
                        "MaxGCPauseMillis (" UINTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   110
                        "less than GCPauseIntervalMillis (" UINTX_FORMAT ")\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   111
                        value, GCPauseIntervalMillis);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   112
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   113
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   114
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   115
  return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   116
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   117
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   118
JVMFlag::Error GCPauseIntervalMillisConstraintFuncG1(uintx value, bool verbose) {
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   119
  if (UseG1GC) {
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   120
    if (FLAG_IS_CMDLINE(GCPauseIntervalMillis)) {
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   121
      if (value < 1) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   122
        JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   123
                            "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   124
                            "greater than or equal to 1\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   125
                            value);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   126
        return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   127
      }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   128
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   129
      if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   130
        JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   131
                            "GCPauseIntervalMillis cannot be set "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   132
                            "without setting MaxGCPauseMillis\n");
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   133
        return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   134
      }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   135
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   136
      if (value <= MaxGCPauseMillis) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   137
        JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   138
                            "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   139
                            "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   140
                            value, MaxGCPauseMillis);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   141
        return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   142
      }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   143
    }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   144
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   145
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   146
  return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   147
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   148
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   149
JVMFlag::Error NewSizeConstraintFuncG1(size_t value, bool verbose) {
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   150
#ifdef _LP64
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   151
  // Overflow would happen for uint type variable of YoungGenSizer::_min_desired_young_length
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   152
  // when the value to be assigned exceeds uint range.
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   153
  // i.e. result of '(uint)(NewSize / region size(1~32MB))'
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   154
  // So maximum of NewSize should be 'max_juint * 1M'
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   155
  if (UseG1GC && (value > (max_juint * 1 * M))) {
50289
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   156
    JVMFlag::printError(verbose,
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   157
                        "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n",
0195ee80e530 8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
gziemski
parents: 49857
diff changeset
   158
                        value);
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   159
    return JVMFlag::VIOLATES_CONSTRAINT;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   160
  }
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   161
#endif // _LP64
49857
31e07291ae29 8081519: Split globals.hpp to factor out the Flag class
gziemski
parents: 49731
diff changeset
   162
  return JVMFlag::SUCCESS;
49731
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   163
}
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   164
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   165
size_t MaxSizeForHeapAlignmentG1() {
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   166
  return HeapRegionBounds::max_size();
635838cb8b3a 8201168: Move GC command line constraint functions to GC specific files
stefank
parents:
diff changeset
   167
}