< prev index next >

src/hotspot/share/jvmci/jvmci_globals.cpp

Print this page

*** 24,49 **** #include "precompiled.hpp" #include "jvm.h" #include "jvmci/jvmci_globals.hpp" #include "gc/shared/gcConfig.hpp" #include "utilities/defaultStream.hpp" #include "utilities/ostream.hpp" ! #include "runtime/globals_extension.hpp" fileStream* JVMCIGlobals::_jni_config_file = NULL; // Return true if jvmci flags are consistent. bool JVMCIGlobals::check_jvmci_flags_are_consistent() { #ifndef PRODUCT ! #define APPLY_JVMCI_FLAGS(params3, params4) \ ! JVMCI_FLAGS(params4, params3, params4, params3, params4, params3, params4, params4, IGNORE_RANGE, IGNORE_CONSTRAINT) ! #define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false; ! #define JVMCI_DECLARE_CHECK3(type, name, doc) bool name##checked = false; ! #define JVMCI_FLAG_CHECKED(name) name##checked = true; ! APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4) #else #define JVMCI_FLAG_CHECKED(name) #endif // Checks that a given flag is not set if a given guard flag is false. --- 24,65 ---- #include "precompiled.hpp" #include "jvm.h" #include "jvmci/jvmci_globals.hpp" #include "gc/shared/gcConfig.hpp" + #include "memory/resourceArea.hpp" + #include "runtime/flags/jvmFlag.inline.hpp" #include "utilities/defaultStream.hpp" #include "utilities/ostream.hpp" ! #include "utilities/resourceHash.hpp" fileStream* JVMCIGlobals::_jni_config_file = NULL; + #ifndef PRODUCT + typedef ResourceHashtable< + void*, + bool, + primitive_hash<void*>, + primitive_equals<void*>, + 139, // prime number + ResourceObj::C_HEAP // It's too early in VM bootstrap, cannot use resource allocation yet + > JVMCIFlagCheckingTable; + + static void set_checked(JVMCIFlagCheckingTable* table, void* flag) { + table->put(flag, true); + } + static bool has_checked(JVMCIFlagCheckingTable* table, void* flag) { + return table->get(flag) != NULL; + } + #endif // PRODUCT + // Return true if jvmci flags are consistent. bool JVMCIGlobals::check_jvmci_flags_are_consistent() { #ifndef PRODUCT ! JVMCIFlagCheckingTable table; ! #define JVMCI_FLAG_CHECKED(name) set_checked(&table, (void*)&name); #else #define JVMCI_FLAG_CHECKED(name) #endif // Checks that a given flag is not set if a given guard flag is false.
*** 127,148 **** JVMCI_FLAG_CHECKED(UseMontgomeryMultiplyIntrinsic) JVMCI_FLAG_CHECKED(UseMontgomerySquareIntrinsic) #endif // !COMPILER2 #ifndef PRODUCT - #define JVMCI_CHECK4(type, name, value, doc) assert(name##checked, #name " flag not checked"); - #define JVMCI_CHECK3(type, name, doc) assert(name##checked, #name " flag not checked"); // Ensures that all JVMCI flags are checked by this method. ! APPLY_JVMCI_FLAGS(JVMCI_CHECK3, JVMCI_CHECK4) ! #undef APPLY_JVMCI_FLAGS ! #undef JVMCI_DECLARE_CHECK3 ! #undef JVMCI_DECLARE_CHECK4 ! #undef JVMCI_CHECK3 ! #undef JVMCI_CHECK4 ! #undef JVMCI_FLAG_CHECKED #endif // PRODUCT - #undef CHECK_NOT_SET if (JVMCILibDumpJNIConfig != NULL) { _jni_config_file = new(ResourceObj::C_HEAP, mtJVMCI) fileStream(JVMCILibDumpJNIConfig); if (_jni_config_file == NULL || !_jni_config_file->is_open()) { jio_fprintf(defaultStream::error_stream(), --- 143,160 ---- JVMCI_FLAG_CHECKED(UseMontgomeryMultiplyIntrinsic) JVMCI_FLAG_CHECKED(UseMontgomerySquareIntrinsic) #endif // !COMPILER2 #ifndef PRODUCT // Ensures that all JVMCI flags are checked by this method. ! JVMFlag* flag; ! JVMFLAG_FOR_EACH(flag) { ! if (flag->attr() & JVMFlag::JVMCI) { ! assert(has_checked(&table, flag->value_addr()), "%s flag not checked", flag->name()); ! } ! } #endif // PRODUCT if (JVMCILibDumpJNIConfig != NULL) { _jni_config_file = new(ResourceObj::C_HEAP, mtJVMCI) fileStream(JVMCILibDumpJNIConfig); if (_jni_config_file == NULL || !_jni_config_file->is_open()) { jio_fprintf(defaultStream::error_stream(),
*** 181,191 **** jvmciFlag->set_product(); } bool value = true; JVMFlag *jvmciEnableFlag = JVMFlag::find_flag("EnableJVMCIProduct"); ! if (JVMFlag::boolAtPut(jvmciEnableFlag, &value, origin) != JVMFlag::SUCCESS) { return false; } // Effect of EnableJVMCIProduct on changing defaults of EnableJVMCI // and UseJVMCICompiler is deferred to check_jvmci_flags_are_consistent --- 193,203 ---- jvmciFlag->set_product(); } bool value = true; JVMFlag *jvmciEnableFlag = JVMFlag::find_flag("EnableJVMCIProduct"); ! if (JVMFlag::boolAtPut(jvmciEnableFlag, value, origin) != JVMFlag::SUCCESS) { return false; } // Effect of EnableJVMCIProduct on changing defaults of EnableJVMCI // and UseJVMCICompiler is deferred to check_jvmci_flags_are_consistent
*** 203,207 **** --- 215,258 ---- FLAG_SET_DEFAULT(EnableJVMCI, false); FLAG_SET_DEFAULT(UseJVMCICompiler, false); } } } + + // -- Define all JVM flags that have been declared in share/jvmci/jvmci_globals.hpp + + // Add JVMFlag::JVMCI to the JVMFlag::attr() for all flags defined in this file + #ifdef FLAG_COMMON_ATTRS + #undef FLAG_COMMON_ATTRS + #endif + #define FLAG_COMMON_ATTRS JVMFlag::JVMCI + + #include "jvmci_globals.hpp" + #include "runtime/flags/jvmFlag.inline.hpp" + DEFN_PRODUCT_FLAG(EnableJVMCI); + DEFN_PRODUCT_FLAG(EnableJVMCIProduct); + DEFN_PRODUCT_FLAG(UseJVMCICompiler); + DEFN_PRODUCT_FLAG(JVMCIPrintProperties); + DEFN_PRODUCT_FLAG(BootstrapJVMCI); + DEFN_PRODUCT_FLAG(EagerJVMCI); + DEFN_PRODUCT_FLAG(PrintBootstrap); + DEFN_PRODUCT_FLAG(JVMCIThreads); DEFN_PRODUCT_RANGE(JVMCIThreads); + DEFN_PRODUCT_FLAG(JVMCIHostThreads); DEFN_PRODUCT_RANGE(JVMCIHostThreads); + NOT_COMPILER2(DEFN_PRODUCT_FLAG(MaxVectorSize);) + + NOT_COMPILER2(DEFN_PRODUCT_FLAG(ReduceInitialCardMarks);) + + DEFN_PRODUCT_FLAG(JVMCITraceLevel); DEFN_PRODUCT_RANGE(JVMCITraceLevel); + DEFN_PRODUCT_FLAG(JVMCICounterSize); DEFN_PRODUCT_RANGE(JVMCICounterSize); + DEFN_PRODUCT_FLAG(JVMCICountersExcludeCompiler); + DEFN_DEVELOP_FLAG(JVMCIUseFastLocking); + DEFN_PRODUCT_FLAG(JVMCINMethodSizeLimit); DEFN_PRODUCT_RANGE(JVMCINMethodSizeLimit); + DEFN_PRODUCT_FLAG(JVMCILibPath); + DEFN_PRODUCT_FLAG(JVMCILibDumpJNIConfig); + DEFN_PRODUCT_FLAG(UseJVMCINativeLibrary); + NOT_COMPILER2(DEFN_PRODUCT_FLAG(UseMultiplyToLenIntrinsic);) + + NOT_COMPILER2(DEFN_PRODUCT_FLAG(UseSquareToLenIntrinsic);) + + NOT_COMPILER2(DEFN_PRODUCT_FLAG(UseMulAddIntrinsic);) + + NOT_COMPILER2(DEFN_PRODUCT_FLAG(UseMontgomeryMultiplyIntrinsic);)
< prev index next >