< prev index next >

src/share/vm/runtime/globals_extension.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2015, 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  *


 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 
 294 // Can't put the following in CommandLineFlags because
 295 // of a circular dependency on the enum definition.
 296 class CommandLineFlagsEx : CommandLineFlags {
 297  public:
 298   static Flag::Error boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin);
 299   static Flag::Error intAtPut(CommandLineFlagWithType flag, int value, Flag::Flags origin);
 300   static Flag::Error uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin);
 301   static Flag::Error intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
 302   static Flag::Error uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
 303   static Flag::Error uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
 304   static Flag::Error size_tAtPut(CommandLineFlagWithType flag, size_t value, Flag::Flags origin);
 305   static Flag::Error doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin);
 306   // Contract:  Flag will make private copy of the incoming value
 307   static Flag::Error ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin);
 308 
 309   static bool is_default(CommandLineFlag flag);
 310   static bool is_ergo(CommandLineFlag flag);
 311   static bool is_cmdline(CommandLineFlag flag);
 312 };
   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  *


 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 };
< prev index next >