annotate src/share/vm/runtime/globals_extension.hpp @ 8569:5bbf25472731

8122937: [JEP 245] Validate JVM Command-Line Flag Arguments. Summary: Validate the arguments to all JVM command-line flags so as to avoid crashes, and ensure that appropriate error messages are displayed when they are invalid. Reviewed-by: ddmitriev, dholmes, kbarrett, drwhite, brutisso, coleenp
author gziemski
date Thu, 18 Jun 2015 14:39:38 -0500
parents 8597e296c18b
children a41fe5ffa839
rev   line source
duke@0 1 /*
gziemski@8569 2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #ifndef SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
stefank@1879 26 #define SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
stefank@1879 27
stefank@1879 28 #include "runtime/globals.hpp"
jprovino@4107 29 #include "utilities/macros.hpp"
stefank@1879 30 #include "utilities/top.hpp"
stefank@1879 31
duke@0 32 // Construct enum of Flag_<cmdline-arg> constants.
duke@0 33
jwilhelm@5862 34 // Parenthesis left off in the following for the enum decl below.
duke@0 35 #define FLAG_MEMBER(flag) Flag_##flag
duke@0 36
twisti@5355 37 #define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 38 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 39 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
ysr@350 40 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 41 #define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 42 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 43 #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 44 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 45 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 46
twisti@5355 47 #ifdef _LP64
twisti@5355 48 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
duke@0 49 #else
twisti@5355 50 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) /* flag is constant */
coleenp@113 51 #endif // _LP64
duke@0 52
twisti@5355 53 #define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 54 #define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 55 #define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 56 #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 57 #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 58 #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
duke@0 59
twisti@5355 60 #define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 61 #define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 62 #define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 63 #define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 64 #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 65 #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
twisti@5355 66 #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
duke@0 67
twisti@3585 68 #define ARCH_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@3585 69 #define ARCH_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@3585 70 #define ARCH_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 71 #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@5355 72 #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
twisti@3585 73
duke@0 74 typedef enum {
gziemski@8569 75 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
gziemski@8569 76 RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
gziemski@8569 77 RUNTIME_PRODUCT_FLAG_MEMBER, \
gziemski@8569 78 RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
gziemski@8569 79 RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 80 RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
gziemski@8569 81 RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 82 RUNTIME_MANAGEABLE_FLAG_MEMBER, \
gziemski@8569 83 RUNTIME_PRODUCT_RW_FLAG_MEMBER, \
gziemski@8569 84 RUNTIME_LP64_PRODUCT_FLAG_MEMBER, \
gziemski@8569 85 IGNORE_RANGE, \
gziemski@8569 86 IGNORE_CONSTRAINT)
gziemski@8569 87 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
gziemski@8569 88 RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
gziemski@8569 89 RUNTIME_PRODUCT_FLAG_MEMBER, \
gziemski@8569 90 RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
gziemski@8569 91 RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 92 RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 93 IGNORE_RANGE, \
gziemski@8569 94 IGNORE_CONSTRAINT)
jprovino@4107 95 #if INCLUDE_ALL_GCS
gziemski@8569 96 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \
gziemski@8569 97 RUNTIME_PD_DEVELOP_FLAG_MEMBER, \
gziemski@8569 98 RUNTIME_PRODUCT_FLAG_MEMBER, \
gziemski@8569 99 RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
gziemski@8569 100 RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 101 RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
gziemski@8569 102 RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 103 RUNTIME_MANAGEABLE_FLAG_MEMBER, \
gziemski@8569 104 RUNTIME_PRODUCT_RW_FLAG_MEMBER, \
gziemski@8569 105 IGNORE_RANGE, \
gziemski@8569 106 IGNORE_CONSTRAINT)
jprovino@4107 107 #endif // INCLUDE_ALL_GCS
duke@0 108 #ifdef COMPILER1
gziemski@8569 109 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, \
gziemski@8569 110 C1_PD_DEVELOP_FLAG_MEMBER, \
gziemski@8569 111 C1_PRODUCT_FLAG_MEMBER, \
gziemski@8569 112 C1_PD_PRODUCT_FLAG_MEMBER, \
gziemski@8569 113 C1_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 114 C1_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 115 IGNORE_RANGE, \
gziemski@8569 116 IGNORE_CONSTRAINT)
duke@0 117 #endif
duke@0 118 #ifdef COMPILER2
gziemski@8569 119 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, \
gziemski@8569 120 C2_PD_DEVELOP_FLAG_MEMBER, \
gziemski@8569 121 C2_PRODUCT_FLAG_MEMBER, \
gziemski@8569 122 C2_PD_PRODUCT_FLAG_MEMBER, \
gziemski@8569 123 C2_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 124 C2_EXPERIMENTAL_FLAG_MEMBER, \
gziemski@8569 125 C2_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 126 IGNORE_RANGE, \
gziemski@8569 127 IGNORE_CONSTRAINT)
duke@0 128 #endif
gziemski@8569 129 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER, \
gziemski@8569 130 ARCH_PRODUCT_FLAG_MEMBER, \
gziemski@8569 131 ARCH_DIAGNOSTIC_FLAG_MEMBER, \
gziemski@8569 132 ARCH_EXPERIMENTAL_FLAG_MEMBER, \
gziemski@8569 133 ARCH_NOTPRODUCT_FLAG_MEMBER, \
gziemski@8569 134 IGNORE_RANGE, \
gziemski@8569 135 IGNORE_CONSTRAINT)
phh@2868 136 COMMANDLINEFLAG_EXT
duke@0 137 NUM_CommandLineFlag
duke@0 138 } CommandLineFlag;
duke@0 139
duke@0 140 // Construct enum of Flag_<cmdline-arg>_<type> constants.
duke@0 141
duke@0 142 #define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type
duke@0 143
twisti@5355 144 #define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 145 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 146 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
ysr@350 147 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 148 #define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 149 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 150 #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 151 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 152 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 153
twisti@5355 154 #define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 155 #define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 156 #define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 157 #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 158 #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 159 #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 160
twisti@5355 161 #ifdef _LP64
twisti@5355 162 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
duke@0 163 #else
twisti@5355 164 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */
coleenp@113 165 #endif // _LP64
duke@0 166
twisti@5355 167 #define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 168 #define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 169 #define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
never@1080 170 #define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 171 #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 172 #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 173 #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
duke@0 174
twisti@3585 175 #define ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@3585 176 #define ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 177 #define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 178 #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@5355 179 #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
twisti@3585 180
duke@0 181 typedef enum {
ysr@342 182 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 183 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 184 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 185 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
duke@0 186 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
ysr@350 187 RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
duke@0 188 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
duke@0 189 RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
coleenp@113 190 RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 191 RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 192 IGNORE_RANGE,
gziemski@8569 193 IGNORE_CONSTRAINT)
ysr@342 194 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 195 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 196 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 197 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 198 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 199 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 200 IGNORE_RANGE,
gziemski@8569 201 IGNORE_CONSTRAINT)
jprovino@4107 202 #if INCLUDE_ALL_GCS
ysr@342 203 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 204 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 205 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 206 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 207 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
ysr@350 208 RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
ysr@342 209 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 210 RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 211 RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 212 IGNORE_RANGE,
gziemski@8569 213 IGNORE_CONSTRAINT)
jprovino@4107 214 #endif // INCLUDE_ALL_GCS
duke@0 215 #ifdef COMPILER1
ysr@342 216 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 217 C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 218 C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 219 C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
roland@5193 220 C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 221 C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 222 IGNORE_RANGE,
gziemski@8569 223 IGNORE_CONSTRAINT)
duke@0 224 #endif
duke@0 225 #ifdef COMPILER2
ysr@342 226 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 227 C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
ysr@342 228 C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 229 C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
ysr@342 230 C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
never@1080 231 C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 232 C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 233 IGNORE_RANGE,
gziemski@8569 234 IGNORE_CONSTRAINT)
duke@0 235 #endif
twisti@3585 236 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE,
twisti@3585 237 ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE,
twisti@3585 238 ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
twisti@3585 239 ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 240 ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
gziemski@8569 241 IGNORE_RANGE,
gziemski@8569 242 IGNORE_CONSTRAINT)
phh@2868 243 COMMANDLINEFLAGWITHTYPE_EXT
duke@0 244 NUM_CommandLineFlagWithType
duke@0 245 } CommandLineFlagWithType;
duke@0 246
duke@0 247 #define FLAG_IS_DEFAULT(name) (CommandLineFlagsEx::is_default(FLAG_MEMBER(name)))
jmasa@13 248 #define FLAG_IS_ERGO(name) (CommandLineFlagsEx::is_ergo(FLAG_MEMBER(name)))
jmasa@13 249 #define FLAG_IS_CMDLINE(name) (CommandLineFlagsEx::is_cmdline(FLAG_MEMBER(name)))
duke@0 250
duke@0 251 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
duke@0 252
twisti@5355 253 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::COMMAND_LINE))
twisti@5355 254 #define FLAG_SET_ERGO(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::ERGONOMIC))
duke@0 255
duke@0 256 // Can't put the following in CommandLineFlags because
duke@0 257 // of a circular dependency on the enum definition.
duke@0 258 class CommandLineFlagsEx : CommandLineFlags {
duke@0 259 public:
gziemski@8569 260 static Flag::Error boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin);
gziemski@8569 261 static Flag::Error intAtPut(CommandLineFlagWithType flag, int value, Flag::Flags origin);
gziemski@8569 262 static Flag::Error uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin);
gziemski@8569 263 static Flag::Error intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
gziemski@8569 264 static Flag::Error uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
gziemski@8569 265 static Flag::Error uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
gziemski@8569 266 static Flag::Error size_tAtPut(CommandLineFlagWithType flag, size_t value, Flag::Flags origin);
gziemski@8569 267 static Flag::Error doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin);
iignatyev@5736 268 // Contract: Flag will make private copy of the incoming value
gziemski@8569 269 static Flag::Error ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin);
duke@0 270
duke@0 271 static bool is_default(CommandLineFlag flag);
jmasa@13 272 static bool is_ergo(CommandLineFlag flag);
jmasa@13 273 static bool is_cmdline(CommandLineFlag flag);
duke@0 274 };
stefank@1879 275
stefank@1879 276 #endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP