< prev index next >

src/share/vm/jvmci/jvmci_globals.cpp

Print this page




   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 #include "precompiled.hpp"
  26 #include "jvmci/jvmci_globals.hpp"


  27 
  28 JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
  29             MATERIALIZE_PD_DEVELOPER_FLAG, \
  30             MATERIALIZE_PRODUCT_FLAG, \
  31             MATERIALIZE_PD_PRODUCT_FLAG, \
  32             MATERIALIZE_DIAGNOSTIC_FLAG, \
  33             MATERIALIZE_EXPERIMENTAL_FLAG, \
  34             MATERIALIZE_NOTPRODUCT_FLAG,
  35             IGNORE_RANGE, \
  36             IGNORE_CONSTRAINT)









































































































































































   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 #include "precompiled.hpp"
  26 #include "jvmci/jvmci_globals.hpp"
  27 #include "utilities/defaultStream.hpp"
  28 #include "runtime/globals_extension.hpp"
  29 
  30 JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
  31             MATERIALIZE_PD_DEVELOPER_FLAG, \
  32             MATERIALIZE_PRODUCT_FLAG, \
  33             MATERIALIZE_PD_PRODUCT_FLAG, \
  34             MATERIALIZE_DIAGNOSTIC_FLAG, \
  35             MATERIALIZE_EXPERIMENTAL_FLAG, \
  36             MATERIALIZE_NOTPRODUCT_FLAG,
  37             IGNORE_RANGE, \
  38             IGNORE_CONSTRAINT)
  39 
  40 
  41 
  42 #define IGNORE_FLAG_FOUR_PARAM(type, name, value, doc)
  43 #define IGNORE_FLAG_THREE_PARAM(type, name, doc)
  44 
  45 // Check if any jvmci global defaults changed.
  46 bool is_any_jvmci_arg_values_changed() {  
  47 
  48   int check_count = 0, fail_count = 0;
  49 
  50   if (!FLAG_IS_DEFAULT(EnableJVMCI)) {
  51     check_count++;
  52   }
  53 
  54 #define EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(FLAG)  \
  55   if (!FLAG_IS_DEFAULT(FLAG)) {                   \
  56     fail_count++;                                 \
  57     if (fail_count > check_count)                 \
  58       return true;                                \
  59   }
  60 
  61 #define JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
  62 #define JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)   EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
  63 
  64   if (UnlockDiagnosticVMOptions) {
  65 
  66     JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
  67                 IGNORE_FLAG_THREE_PARAM, \
  68                 IGNORE_FLAG_FOUR_PARAM, \
  69                 IGNORE_FLAG_THREE_PARAM, \
  70                 JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE, \
  71                 IGNORE_FLAG_FOUR_PARAM, \
  72                 IGNORE_FLAG_FOUR_PARAM, \
  73                 IGNORE_RANGE, \
  74                 IGNORE_CONSTRAINT)
  75 
  76   }
  77 
  78   if (UnlockExperimentalVMOptions) {
  79 
  80     JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
  81                 IGNORE_FLAG_THREE_PARAM, \
  82                 IGNORE_FLAG_FOUR_PARAM, \
  83                 IGNORE_FLAG_THREE_PARAM, \
  84                 IGNORE_FLAG_FOUR_PARAM, \
  85                 JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE, \
  86                 IGNORE_FLAG_FOUR_PARAM, \
  87                 IGNORE_RANGE, \
  88                 IGNORE_CONSTRAINT)
  89 
  90   }
  91 
  92 #ifndef PRODUCT
  93 #define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
  94 #define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
  95 #define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
  96 #else
  97 #define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)
  98 #define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)
  99 #define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)
 100 #endif
 101 
 102 #define JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
 103 #define JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
 104 
 105   JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE, \
 106               JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE, \
 107               JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
 108               JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
 109               IGNORE_FLAG_FOUR_PARAM, \
 110               IGNORE_FLAG_FOUR_PARAM, \
 111               JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
 112               IGNORE_RANGE, \
 113               IGNORE_CONSTRAINT)
 114 
 115 #undef EMIT_FLAG_VALUE_CHANGED_CHECK_CODE
 116 #undef JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE
 117 #undef JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE
 118 #undef JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
 119 #undef JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE
 120 #undef JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
 121 #undef JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
 122 #undef JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE
 123 
 124   return false;
 125 }
 126 
 127 // Print jvmci args inconsistency error message.
 128 void print_jvmci_arg_inconsistency_error_message() {
 129   const char* error_msg = "Improperly specified VM option '%s'\n";
 130 
 131   jio_fprintf(defaultStream::error_stream(), "EnableJVMCI must be enabled\n");
 132 
 133 #define EMIT_CHECK_PRINT_ERROR_MSG(FLAG)                            \
 134   if (!FLAG_IS_DEFAULT(FLAG)) {                                     \
 135     if (strcmp(#FLAG, "EnableJVMCI"))                               \
 136       jio_fprintf(defaultStream::error_stream(), error_msg, #FLAG); \
 137   }
 138 
 139 #define JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)     EMIT_CHECK_PRINT_ERROR_MSG(name)
 140 #define JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)   EMIT_CHECK_PRINT_ERROR_MSG(name)
 141 
 142   if (UnlockDiagnosticVMOptions) {
 143 
 144     JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
 145                 IGNORE_FLAG_THREE_PARAM, \
 146                 IGNORE_FLAG_FOUR_PARAM, \
 147                 IGNORE_FLAG_THREE_PARAM, \
 148                 JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG, \
 149                 IGNORE_FLAG_FOUR_PARAM, \
 150                 IGNORE_FLAG_FOUR_PARAM, \
 151                 IGNORE_RANGE, \
 152                 IGNORE_CONSTRAINT)
 153 
 154   }
 155 
 156   if (UnlockExperimentalVMOptions) {
 157 
 158     JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
 159                 IGNORE_FLAG_THREE_PARAM, \
 160                 IGNORE_FLAG_FOUR_PARAM, \
 161                 IGNORE_FLAG_THREE_PARAM, \
 162                 IGNORE_FLAG_FOUR_PARAM, \
 163                 JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG, \
 164                 IGNORE_FLAG_FOUR_PARAM, \
 165                 IGNORE_RANGE, \
 166                 IGNORE_CONSTRAINT)
 167 
 168   }
 169 
 170 #ifndef PRODUCT
 171 #define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)        EMIT_CHECK_PRINT_ERROR_MSG(name)
 172 #define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)            EMIT_CHECK_PRINT_ERROR_MSG(name)
 173 #define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)     EMIT_CHECK_PRINT_ERROR_MSG(name)
 174 #else
 175 #define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)
 176 #define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)
 177 #define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)
 178 #endif
 179 
 180 #define JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)            EMIT_CHECK_PRINT_ERROR_MSG(name)
 181 #define JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)        EMIT_CHECK_PRINT_ERROR_MSG(name)
 182   
 183   JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG, \
 184               JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG, \
 185               JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
 186               JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
 187               IGNORE_FLAG_FOUR_PARAM, \
 188               IGNORE_FLAG_FOUR_PARAM, \
 189               JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
 190               IGNORE_RANGE, \
 191               IGNORE_CONSTRAINT)
 192 
 193 #undef EMIT_CHECK_PRINT_ERROR_MSG
 194 #undef JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG
 195 #undef JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG
 196 #undef JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
 197 #undef JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
 198 #undef JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
 199 #undef JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG
 200 #undef JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG
 201 
 202 }
 203 
 204 #undef IGNORE_FLAG_FOUR_PARAM
 205 #undef IGNORE_FLAG_THREE_PARAM
< prev index next >