< prev index next >

src/share/vm/jvmci/jvmci_globals.cpp

Print this page

        

@@ -22,15 +22,184 @@
  *
  */
 
 #include "precompiled.hpp"
 #include "jvmci/jvmci_globals.hpp"
+#include "utilities/defaultStream.hpp"
+#include "runtime/globals_extension.hpp"
 
 JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
             MATERIALIZE_PD_DEVELOPER_FLAG, \
             MATERIALIZE_PRODUCT_FLAG, \
             MATERIALIZE_PD_PRODUCT_FLAG, \
             MATERIALIZE_DIAGNOSTIC_FLAG, \
             MATERIALIZE_EXPERIMENTAL_FLAG, \
             MATERIALIZE_NOTPRODUCT_FLAG,
             IGNORE_RANGE, \
             IGNORE_CONSTRAINT)
+
+
+
+#define IGNORE_FLAG_FOUR_PARAM(type, name, value, doc)
+#define IGNORE_FLAG_THREE_PARAM(type, name, doc)
+
+// Check if any jvmci global defaults changed.
+bool is_any_jvmci_arg_values_changed() {  
+
+  int check_count = 0, fail_count = 0;
+
+  if (!FLAG_IS_DEFAULT(EnableJVMCI)) {
+    check_count++;
+  }
+
+#define EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(FLAG)  \
+  if (!FLAG_IS_DEFAULT(FLAG)) {                   \
+    fail_count++;                                 \
+    if (fail_count > check_count)                 \
+      return true;                                \
+  }
+
+#define JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#define JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)   EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+
+  if (UnlockDiagnosticVMOptions) {
+
+    JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_RANGE, \
+                IGNORE_CONSTRAINT)
+
+  }
+
+  if (UnlockExperimentalVMOptions) {
+
+    JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_RANGE, \
+                IGNORE_CONSTRAINT)
+
+  }
+
+#ifndef PRODUCT
+#define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#else
+#define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)
+#define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)
+#define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)
+#endif
+
+#define JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#define JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+
+  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE, \
+              JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE, \
+              JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
+              JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
+              IGNORE_FLAG_FOUR_PARAM, \
+              IGNORE_FLAG_FOUR_PARAM, \
+              JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE, \
+              IGNORE_RANGE, \
+              IGNORE_CONSTRAINT)
+
+#undef EMIT_FLAG_VALUE_CHANGED_CHECK_CODE
+#undef JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECKCODE
+#undef JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECKCODE
+
+  return false;
+}
+
+// Print jvmci args inconsistency error message.
+void print_jvmci_arg_inconsistency_error_message() {
+  const char* error_msg = "Improperly specified VM option '%s'\n";
+
+  jio_fprintf(defaultStream::error_stream(), "EnableJVMCI must be enabled\n");
+
+#define EMIT_CHECK_PRINT_ERROR_MSG(FLAG)                            \
+  if (!FLAG_IS_DEFAULT(FLAG)) {                                     \
+    if (strcmp(#FLAG, "EnableJVMCI"))                               \
+      jio_fprintf(defaultStream::error_stream(), error_msg, #FLAG); \
+  }
+
+#define JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)     EMIT_CHECK_PRINT_ERROR_MSG(name)
+#define JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)   EMIT_CHECK_PRINT_ERROR_MSG(name)
+
+  if (UnlockDiagnosticVMOptions) {
+
+    JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_RANGE, \
+                IGNORE_CONSTRAINT)
+
+  }
+
+  if (UnlockExperimentalVMOptions) {
+
+    JVMCI_FLAGS(IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_FLAG_THREE_PARAM, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG, \
+                IGNORE_FLAG_FOUR_PARAM, \
+                IGNORE_RANGE, \
+                IGNORE_CONSTRAINT)
+
+  }
+
+#ifndef PRODUCT
+#define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)        EMIT_CHECK_PRINT_ERROR_MSG(name)
+#define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)            EMIT_CHECK_PRINT_ERROR_MSG(name)
+#define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)     EMIT_CHECK_PRINT_ERROR_MSG(name)
+#else
+#define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)
+#define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)
+#define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)
+#endif
+
+#define JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, doc)            EMIT_CHECK_PRINT_ERROR_MSG(name)
+#define JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG(type, name, value, doc)        EMIT_CHECK_PRINT_ERROR_MSG(name)
+  
+  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG, \
+              JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG, \
+              JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
+              JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
+              IGNORE_FLAG_FOUR_PARAM, \
+              IGNORE_FLAG_FOUR_PARAM, \
+              JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG, \
+              IGNORE_RANGE, \
+              IGNORE_CONSTRAINT)
+
+#undef EMIT_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERROR_MSG
+#undef JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERROR_MSG
+
+}
+
+#undef IGNORE_FLAG_FOUR_PARAM
+#undef IGNORE_FLAG_THREE_PARAM
< prev index next >