src/share/vm/runtime/globals_extension.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2008, 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 // Construct enum of Flag_<cmdline-arg> constants.
  26 
  27 // Parens left off in the following for the enum decl below.
  28 #define FLAG_MEMBER(flag) Flag_##flag
  29 
  30 #define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
  31 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc)        FLAG_MEMBER(name),
  32 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  33 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  34 #define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  35 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  36 #ifdef PRODUCT
  37   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  /* flag is constant */
  38   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      /* flag is constant */
  39   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
  40 #else
  41   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  FLAG_MEMBER(name),
  42   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      FLAG_MEMBER(name),
  43   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  44 #endif


 196 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
 197 
 198 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), COMMAND_LINE))
 199 #define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), ERGONOMIC))
 200 
 201 // Can't put the following in CommandLineFlags because
 202 // of a circular dependency on the enum definition.
 203 class CommandLineFlagsEx : CommandLineFlags {
 204  public:
 205   static void boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin);
 206   static void intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin);
 207   static void uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin);
 208   static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin);
 209   static void doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin);
 210   static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin);
 211 
 212   static bool is_default(CommandLineFlag flag);
 213   static bool is_ergo(CommandLineFlag flag);
 214   static bool is_cmdline(CommandLineFlag flag);
 215 };


   1 /*
   2  * Copyright (c) 2003, 2010, 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/top.hpp"
  30 
  31 // Construct enum of Flag_<cmdline-arg> constants.
  32 
  33 // Parens left off in the following for the enum decl below.
  34 #define FLAG_MEMBER(flag) Flag_##flag
  35 
  36 #define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
  37 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc)        FLAG_MEMBER(name),
  38 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  39 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  40 #define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  41 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  42 #ifdef PRODUCT
  43   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  /* flag is constant */
  44   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      /* flag is constant */
  45   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
  46 #else
  47   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  FLAG_MEMBER(name),
  48   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      FLAG_MEMBER(name),
  49   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
  50 #endif


 202 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
 203 
 204 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), COMMAND_LINE))
 205 #define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), ERGONOMIC))
 206 
 207 // Can't put the following in CommandLineFlags because
 208 // of a circular dependency on the enum definition.
 209 class CommandLineFlagsEx : CommandLineFlags {
 210  public:
 211   static void boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin);
 212   static void intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin);
 213   static void uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin);
 214   static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin);
 215   static void doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin);
 216   static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin);
 217 
 218   static bool is_default(CommandLineFlag flag);
 219   static bool is_ergo(CommandLineFlag flag);
 220   static bool is_cmdline(CommandLineFlag flag);
 221 };
 222 
 223 #endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP