src/share/vm/runtime/globals_extension.hpp

Tue, 24 Jun 2008 13:20:34 -0700

author
ysr
date
Tue, 24 Jun 2008 13:20:34 -0700
changeset 783
69fefd031e6c
parent 777
37f87013dfd8
child 785
d28aa69f0959
permissions
-rw-r--r--

Merge

     1 /*
     2  * Copyright 2003-2006 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
    22  *
    23  */
    25 // Construct enum of Flag_<cmdline-arg> constants.
    27 // Parens left off in the following for the enum decl below.
    28 #define FLAG_MEMBER(flag) Flag_##flag
    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_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
    34 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
    35 #ifdef PRODUCT
    36   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  /* flag is constant */
    37   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      /* flag is constant */
    38   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
    39 #else
    40   #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  FLAG_MEMBER(name),
    41   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      FLAG_MEMBER(name),
    42   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
    43 #endif
    44 #ifdef _LP64
    45 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
    46 #else
    47 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc)    /* flag is constant */
    48 #endif // _LP64
    50 #define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
    51 #define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc)             FLAG_MEMBER(name),
    52 #ifdef PRODUCT
    53   #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc)       /* flag is constant */
    54   #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           /* flag is constant */
    55   #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
    56 #else
    57   #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc)       FLAG_MEMBER(name),
    58   #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           FLAG_MEMBER(name),
    59   #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
    60 #endif
    63 #define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
    64 #define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc)             FLAG_MEMBER(name),
    65 #define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
    66 #ifdef PRODUCT
    67   #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc)       /* flag is constant */
    68   #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           /* flag is constant */
    69   #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
    70 #else
    71   #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc)       FLAG_MEMBER(name),
    72   #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           FLAG_MEMBER(name),
    73   #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
    74 #endif
    76 typedef enum {
    77  RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER)
    78  RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER)
    79 #ifndef KERNEL
    80  G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER)
    81 #endif
    82 #ifdef COMPILER1
    83  C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, C1_PD_DEVELOP_FLAG_MEMBER, C1_PRODUCT_FLAG_MEMBER, C1_PD_PRODUCT_FLAG_MEMBER, C1_NOTPRODUCT_FLAG_MEMBER)
    84 #endif
    85 #ifdef COMPILER2
    86  C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, C2_PD_DEVELOP_FLAG_MEMBER, C2_PRODUCT_FLAG_MEMBER, C2_PD_PRODUCT_FLAG_MEMBER, C2_DIAGNOSTIC_FLAG_MEMBER, C2_NOTPRODUCT_FLAG_MEMBER)
    87 #endif
    88  NUM_CommandLineFlag
    89 } CommandLineFlag;
    91 // Construct enum of Flag_<cmdline-arg>_<type> constants.
    93 #define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type
    95 #define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
    96 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
    97 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
    98 #define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
    99 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
   100 #ifdef PRODUCT
   101   #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     /* flag is constant */
   102   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)         /* flag is constant */
   103   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
   104 #else
   105   #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     FLAG_MEMBER_WITH_TYPE(name,type),
   106   #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
   107   #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)  FLAG_MEMBER_WITH_TYPE(name,type),
   108 #endif
   110 #define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
   111 #define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)             FLAG_MEMBER_WITH_TYPE(name,type),
   112 #ifdef PRODUCT
   113   #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       /* flag is constant */
   114   #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           /* flag is constant */
   115   #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
   116 #else
   117   #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       FLAG_MEMBER_WITH_TYPE(name,type),
   118   #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
   119   #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
   120 #endif
   121 #ifdef _LP64
   122 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
   123 #else
   124 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    /* flag is constant */
   125 #endif // _LP64
   128 #define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
   129 #define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)             FLAG_MEMBER_WITH_TYPE(name,type),
   130 #define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
   131 #ifdef PRODUCT
   132   #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       /* flag is constant */
   133   #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           /* flag is constant */
   134   #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
   135 #else
   136   #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       FLAG_MEMBER_WITH_TYPE(name,type),
   137   #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
   138   #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
   139 #endif
   141 typedef enum {
   142  RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   143                RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   144                RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   145                RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   146                RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
   147                RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
   148                RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
   149                RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
   150                RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE)
   151  RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   152                   RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   153                   RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   154                   RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   155                   RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
   156                   RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
   157 #ifndef KERNEL
   158  G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   159           RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   160           RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   161           RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   162           RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
   163           RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
   164           RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
   165           RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE)
   166 #endif // KERNEL
   167 #ifdef COMPILER1
   168  C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   169           C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   170           C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   171           C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   172           C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
   173 #endif
   174 #ifdef COMPILER2
   175  C2_FLAGS(C2_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   176           C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
   177           C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   178           C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
   179           C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
   180           C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
   181 #endif
   182  NUM_CommandLineFlagWithType
   183 } CommandLineFlagWithType;
   185 #define FLAG_IS_DEFAULT(name)         (CommandLineFlagsEx::is_default(FLAG_MEMBER(name)))
   186 #define FLAG_IS_ERGO(name)            (CommandLineFlagsEx::is_ergo(FLAG_MEMBER(name)))
   187 #define FLAG_IS_CMDLINE(name)         (CommandLineFlagsEx::is_cmdline(FLAG_MEMBER(name)))
   189 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
   191 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), COMMAND_LINE))
   192 #define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), ERGONOMIC))
   194 // Can't put the following in CommandLineFlags because
   195 // of a circular dependency on the enum definition.
   196 class CommandLineFlagsEx : CommandLineFlags {
   197  public:
   198   static void boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin);
   199   static void intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin);
   200   static void uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin);
   201   static void doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin);
   202   static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin);
   204   static bool is_default(CommandLineFlag flag);
   205   static bool is_ergo(CommandLineFlag flag);
   206   static bool is_cmdline(CommandLineFlag flag);
   207 };

mercurial