1 /*
   2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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 
  25 #ifndef SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
  26 #define SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
  27 
  28 #include "runtime/globals.hpp"
  29 #include "utilities/macros.hpp"
  30 #include "utilities/top.hpp"
  31 
  32 // Construct enum of Flag_<cmdline-arg> constants.
  33 
  34 // Parenthesis left off in the following for the enum decl below.
  35 #define FLAG_MEMBER(flag) Flag_##flag
  36 
  37 #define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
  38 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc)          FLAG_MEMBER(name),
  39 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)   FLAG_MEMBER(name),
  40 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  41 #define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc)   FLAG_MEMBER(name),
  42 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc)   FLAG_MEMBER(name),
  43 #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
  44 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)          FLAG_MEMBER(name),
  45 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)   FLAG_MEMBER(name),
  46 
  47 #define JVMCI_PRODUCT_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  48 #define JVMCI_PD_PRODUCT_FLAG_MEMBER(type, name, doc)            FLAG_MEMBER(name),
  49 #define JVMCI_DEVELOP_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  50 #define JVMCI_PD_DEVELOP_FLAG_MEMBER(type, name, doc)            FLAG_MEMBER(name),
  51 #define JVMCI_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)     FLAG_MEMBER(name),
  52 #define JVMCI_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc)   FLAG_MEMBER(name),
  53 #define JVMCI_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)     FLAG_MEMBER(name),
  54 
  55 #ifdef _LP64
  56 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  57 #else
  58 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) /* flag is constant */
  59 #endif // _LP64
  60 
  61 #define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc)           FLAG_MEMBER(name),
  62 #define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc)               FLAG_MEMBER(name),
  63 #define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  64 #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc)           FLAG_MEMBER(name),
  65 #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc)               FLAG_MEMBER(name),
  66 #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  67 
  68 #define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc)           FLAG_MEMBER(name),
  69 #define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc)               FLAG_MEMBER(name),
  70 #define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  71 #define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
  72 #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc)           FLAG_MEMBER(name),
  73 #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc)               FLAG_MEMBER(name),
  74 #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)        FLAG_MEMBER(name),
  75 
  76 #define ARCH_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
  77 #define ARCH_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
  78 #define ARCH_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
  79 #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
  80 #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
  81 
  82 typedef enum {
  83  RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
  84                RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
  85                RUNTIME_PRODUCT_FLAG_MEMBER, \
  86                RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
  87                RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
  88                RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
  89                RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
  90                RUNTIME_MANAGEABLE_FLAG_MEMBER, \
  91                RUNTIME_PRODUCT_RW_FLAG_MEMBER, \
  92                RUNTIME_LP64_PRODUCT_FLAG_MEMBER, \
  93                IGNORE_RANGE, \
  94                IGNORE_CONSTRAINT)
  95  RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
  96                   RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
  97                   RUNTIME_PRODUCT_FLAG_MEMBER, \
  98                   RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
  99                   RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
 100                   RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
 101                   IGNORE_RANGE, \
 102                   IGNORE_CONSTRAINT)
 103 #if INCLUDE_ALL_GCS
 104  G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
 105           RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
 106           RUNTIME_PRODUCT_FLAG_MEMBER, \
 107           RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
 108           RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
 109           RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
 110           RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
 111           RUNTIME_MANAGEABLE_FLAG_MEMBER, \
 112           RUNTIME_PRODUCT_RW_FLAG_MEMBER, \
 113           IGNORE_RANGE, \
 114           IGNORE_CONSTRAINT)
 115 #endif // INCLUDE_ALL_GCS
 116 #if INCLUDE_JVMCI
 117  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_MEMBER, \
 118              JVMCI_PD_DEVELOP_FLAG_MEMBER, \
 119              JVMCI_PRODUCT_FLAG_MEMBER, \
 120              JVMCI_PD_PRODUCT_FLAG_MEMBER, \
 121              JVMCI_DIAGNOSTIC_FLAG_MEMBER, \
 122              JVMCI_EXPERIMENTAL_FLAG_MEMBER, \
 123              JVMCI_NOTPRODUCT_FLAG_MEMBER, \
 124              IGNORE_RANGE, \
 125              IGNORE_CONSTRAINT)
 126 #endif // INCLUDE_JVMCI
 127 #ifdef COMPILER1
 128  C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, \
 129           C1_PD_DEVELOP_FLAG_MEMBER, \
 130           C1_PRODUCT_FLAG_MEMBER, \
 131           C1_PD_PRODUCT_FLAG_MEMBER, \
 132           C1_DIAGNOSTIC_FLAG_MEMBER, \
 133           C1_NOTPRODUCT_FLAG_MEMBER, \
 134           IGNORE_RANGE, \
 135           IGNORE_CONSTRAINT)
 136 #endif
 137 #ifdef COMPILER2
 138  C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, \
 139           C2_PD_DEVELOP_FLAG_MEMBER, \
 140           C2_PRODUCT_FLAG_MEMBER, \
 141           C2_PD_PRODUCT_FLAG_MEMBER, \
 142           C2_DIAGNOSTIC_FLAG_MEMBER, \
 143           C2_EXPERIMENTAL_FLAG_MEMBER, \
 144           C2_NOTPRODUCT_FLAG_MEMBER, \
 145           IGNORE_RANGE, \
 146           IGNORE_CONSTRAINT)
 147 #endif
 148  ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER, \
 149             ARCH_PRODUCT_FLAG_MEMBER, \
 150             ARCH_DIAGNOSTIC_FLAG_MEMBER, \
 151             ARCH_EXPERIMENTAL_FLAG_MEMBER, \
 152             ARCH_NOTPRODUCT_FLAG_MEMBER, \
 153             IGNORE_RANGE, \
 154             IGNORE_CONSTRAINT)
 155  COMMANDLINEFLAG_EXT
 156  NUM_CommandLineFlag
 157 } CommandLineFlag;
 158 
 159 // Construct enum of Flag_<cmdline-arg>_<type> constants.
 160 
 161 #define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type
 162 
 163 #define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
 164 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)          FLAG_MEMBER_WITH_TYPE(name,type),
 165 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)   FLAG_MEMBER_WITH_TYPE(name,type),
 166 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
 167 #define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)   FLAG_MEMBER_WITH_TYPE(name,type),
 168 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)   FLAG_MEMBER_WITH_TYPE(name,type),
 169 #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
 170 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)          FLAG_MEMBER_WITH_TYPE(name,type),
 171 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)   FLAG_MEMBER_WITH_TYPE(name,type),
 172 
 173 #define JVMCI_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 174 #define JVMCI_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)            FLAG_MEMBER_WITH_TYPE(name,type),
 175 #define JVMCI_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 176 #define JVMCI_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)            FLAG_MEMBER_WITH_TYPE(name,type),
 177 #define JVMCI_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     FLAG_MEMBER_WITH_TYPE(name,type),
 178 #define JVMCI_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)   FLAG_MEMBER_WITH_TYPE(name,type),
 179 #define JVMCI_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     FLAG_MEMBER_WITH_TYPE(name,type),
 180 
 181 #define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
 182 #define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)               FLAG_MEMBER_WITH_TYPE(name,type),
 183 #define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 184 #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
 185 #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)               FLAG_MEMBER_WITH_TYPE(name,type),
 186 #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 187 
 188 #ifdef _LP64
 189 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
 190 #else
 191 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */
 192 #endif // _LP64
 193 
 194 #define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
 195 #define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)               FLAG_MEMBER_WITH_TYPE(name,type),
 196 #define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 197 #define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
 198 #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
 199 #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)               FLAG_MEMBER_WITH_TYPE(name,type),
 200 #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
 201 
 202 #define ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
 203 #define ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
 204 #define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
 205 #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
 206 #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
 207 
 208 typedef enum {
 209  RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 210                RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 211                RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 212                RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 213                RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 214                RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
 215                RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 216                RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
 217                RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
 218                RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 219                IGNORE_RANGE,
 220                IGNORE_CONSTRAINT)
 221  RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 222                   RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 223                   RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 224                   RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 225                   RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 226                   RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 227                   IGNORE_RANGE,
 228                   IGNORE_CONSTRAINT)
 229 #if INCLUDE_ALL_GCS
 230  G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 231           RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 232           RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 233           RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 234           RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 235           RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
 236           RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 237           RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
 238           RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
 239           IGNORE_RANGE,
 240           IGNORE_CONSTRAINT)
 241 #endif // INCLUDE_ALL_GCS
 242 #if INCLUDE_JVMCI
 243  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 244              JVMCI_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 245              JVMCI_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 246              JVMCI_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 247              JVMCI_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 248              JVMCI_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
 249              JVMCI_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 250              IGNORE_RANGE,
 251              IGNORE_CONSTRAINT)
 252 #endif // INCLUDE_JVMCI
 253 #ifdef COMPILER1
 254  C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 255           C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 256           C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 257           C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 258           C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 259           C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 260           IGNORE_RANGE,
 261           IGNORE_CONSTRAINT)
 262 #endif
 263 #ifdef COMPILER2
 264  C2_FLAGS(C2_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 265           C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 266           C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 267           C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 268           C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 269           C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
 270           C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 271           IGNORE_RANGE,
 272           IGNORE_CONSTRAINT)
 273 #endif
 274  ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE,
 275           ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE,
 276           ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
 277           ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
 278           ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
 279           IGNORE_RANGE,
 280           IGNORE_CONSTRAINT)
 281  COMMANDLINEFLAGWITHTYPE_EXT
 282  NUM_CommandLineFlagWithType
 283 } CommandLineFlagWithType;
 284 
 285 #define FLAG_IS_DEFAULT(name)         (CommandLineFlagsEx::is_default(FLAG_MEMBER(name)))
 286 #define FLAG_IS_ERGO(name)            (CommandLineFlagsEx::is_ergo(FLAG_MEMBER(name)))
 287 #define FLAG_IS_CMDLINE(name)         (CommandLineFlagsEx::is_cmdline(FLAG_MEMBER(name)))
 288 
 289 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
 290 
 291 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::COMMAND_LINE))
 292 #define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::ERGONOMIC))
 293 #define FLAG_SET_ERGO_IF_DEFAULT(type, name, value) \
 294   do {                                              \
 295     if (FLAG_IS_DEFAULT(name)) {                    \
 296       FLAG_SET_ERGO(type, name, value);             \
 297     }                                               \
 298   } while (0)
 299 
 300 // Can't put the following in CommandLineFlags because
 301 // of a circular dependency on the enum definition.
 302 class CommandLineFlagsEx : CommandLineFlags {
 303  public:
 304   static Flag::Error boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin);
 305   static Flag::Error intAtPut(CommandLineFlagWithType flag, int value, Flag::Flags origin);
 306   static Flag::Error uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin);
 307   static Flag::Error intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
 308   static Flag::Error uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
 309   static Flag::Error uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
 310   static Flag::Error size_tAtPut(CommandLineFlagWithType flag, size_t value, Flag::Flags origin);
 311   static Flag::Error doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin);
 312   // Contract:  Flag will make private copy of the incoming value
 313   static Flag::Error ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin);
 314 
 315   static bool is_default(CommandLineFlag flag);
 316   static bool is_ergo(CommandLineFlag flag);
 317   static bool is_cmdline(CommandLineFlag flag);
 318 };
 319 
 320 #endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP