48 #include "runtime/commandLineFlagRangeList.hpp" |
48 #include "runtime/commandLineFlagRangeList.hpp" |
49 #include "runtime/globals.hpp" |
49 #include "runtime/globals.hpp" |
50 #include "runtime/globals_extension.hpp" |
50 #include "runtime/globals_extension.hpp" |
51 #include "runtime/java.hpp" |
51 #include "runtime/java.hpp" |
52 #include "runtime/os.hpp" |
52 #include "runtime/os.hpp" |
|
53 #include "runtime/safepointMechanism.hpp" |
53 #include "runtime/vm_version.hpp" |
54 #include "runtime/vm_version.hpp" |
54 #include "services/management.hpp" |
55 #include "services/management.hpp" |
55 #include "services/memTracker.hpp" |
56 #include "services/memTracker.hpp" |
56 #include "utilities/align.hpp" |
57 #include "utilities/align.hpp" |
57 #include "utilities/defaultStream.hpp" |
58 #include "utilities/defaultStream.hpp" |
4618 if (!UseBiasedLocking || EmitSync != 0) { |
4619 if (!UseBiasedLocking || EmitSync != 0) { |
4619 UseOptoBiasInlining = false; |
4620 UseOptoBiasInlining = false; |
4620 } |
4621 } |
4621 #endif |
4622 #endif |
4622 |
4623 |
|
4624 bool aot_enabled = UseAOT && AOTLibrary != NULL; |
|
4625 bool jvmci_enabled = NOT_JVMCI(false) JVMCI_ONLY(EnableJVMCI || UseJVMCICompiler); |
|
4626 bool handshakes_supported = SafepointMechanism::supports_thread_local_poll() && !aot_enabled && !jvmci_enabled && ThreadLocalHandshakes; |
|
4627 // ThreadLocalHandshakesConstraintFunc handles the constraints. |
|
4628 // Here we try to figure out if a mutual exclusive option have been set that conflict with a default. |
|
4629 if (handshakes_supported) { |
|
4630 FLAG_SET_DEFAULT(UseAOT, false); // Clear the AOT flag to make sure it doesn't try to initialize. |
|
4631 } else { |
|
4632 if (FLAG_IS_DEFAULT(ThreadLocalHandshakes) && ThreadLocalHandshakes) { |
|
4633 if (aot_enabled) { |
|
4634 // If user enabled AOT but ThreadLocalHandshakes is at default set it to false. |
|
4635 log_debug(ergo)("Disabling ThreadLocalHandshakes for UseAOT."); |
|
4636 FLAG_SET_DEFAULT(ThreadLocalHandshakes, false); |
|
4637 } else if (jvmci_enabled){ |
|
4638 // If user enabled JVMCI but ThreadLocalHandshakes is at default set it to false. |
|
4639 log_debug(ergo)("Disabling ThreadLocalHandshakes for EnableJVMCI/UseJVMCICompiler."); |
|
4640 FLAG_SET_DEFAULT(ThreadLocalHandshakes, false); |
|
4641 } |
|
4642 } |
|
4643 } |
|
4644 if (FLAG_IS_DEFAULT(ThreadLocalHandshakes) || !SafepointMechanism::supports_thread_local_poll()) { |
|
4645 log_debug(ergo)("ThreadLocalHandshakes %s", ThreadLocalHandshakes ? "enabled." : "disabled."); |
|
4646 } else { |
|
4647 log_info(ergo)("ThreadLocalHandshakes %s", ThreadLocalHandshakes ? "enabled." : "disabled."); |
|
4648 } |
|
4649 |
4623 return JNI_OK; |
4650 return JNI_OK; |
4624 } |
4651 } |
4625 |
4652 |
4626 jint Arguments::adjust_after_os() { |
4653 jint Arguments::adjust_after_os() { |
4627 if (UseNUMA) { |
4654 if (UseNUMA) { |