4599
4600 if (PrintCommandLineFlags) {
4601 CommandLineFlags::printSetFlags(tty);
4602 }
4603
4604 // Apply CPU specific policy for the BiasedLocking
4605 if (UseBiasedLocking) {
4606 if (!VM_Version::use_biased_locking() &&
4607 !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4608 UseBiasedLocking = false;
4609 }
4610 }
4611 #ifdef COMPILER2
4612 if (!UseBiasedLocking || EmitSync != 0) {
4613 UseOptoBiasInlining = false;
4614 }
4615 #endif
4616
4617 bool aot_enabled = UseAOT && ((AOTLibrary != NULL) || !FLAG_IS_DEFAULT(UseAOT));
4618 bool jvmci_enabled = NOT_JVMCI(false) JVMCI_ONLY(EnableJVMCI || UseJVMCICompiler);
4619 bool handshakes_supported = SafepointMechanism::supports_thread_local_poll() && !aot_enabled && !jvmci_enabled;
4620 if (handshakes_supported) {
4621 if (FLAG_IS_DEFAULT(UseAOT)) {
4622 FLAG_SET_DEFAULT(UseAOT, false); // Clear the AOT flag to make sure it doesn't try to initialize.
4623 }
4624 if (FLAG_IS_DEFAULT(ThreadLocalHandshakes) && !ThreadLocalHandshakes) {
4625 FLAG_SET_ERGO(bool, ThreadLocalHandshakes, true);
4626 log_info(ergo)("Enabling ThreadLocalHandshakes on supported platform");
4627 }
4628 }
4629
4630 return JNI_OK;
4631 }
4632
4633 jint Arguments::adjust_after_os() {
4634 if (UseNUMA) {
4635 if (UseParallelGC || UseParallelOldGC) {
4636 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
4637 FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
4638 }
4639 }
4640 // UseNUMAInterleaving is set to ON for all collectors and
4641 // platforms when UseNUMA is set to ON. NUMA-aware collectors
4642 // such as the parallel collector for Linux and Solaris will
4643 // interleave old gen and survivor spaces on top of NUMA
4644 // allocation policy for the eden space.
4645 // Non NUMA-aware collectors such as CMS, G1 and Serial-GC on
4646 // all platforms and ParallelGC on Windows will interleave all
4647 // of the heap spaces across NUMA nodes.
|
4599
4600 if (PrintCommandLineFlags) {
4601 CommandLineFlags::printSetFlags(tty);
4602 }
4603
4604 // Apply CPU specific policy for the BiasedLocking
4605 if (UseBiasedLocking) {
4606 if (!VM_Version::use_biased_locking() &&
4607 !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4608 UseBiasedLocking = false;
4609 }
4610 }
4611 #ifdef COMPILER2
4612 if (!UseBiasedLocking || EmitSync != 0) {
4613 UseOptoBiasInlining = false;
4614 }
4615 #endif
4616
4617 bool aot_enabled = UseAOT && ((AOTLibrary != NULL) || !FLAG_IS_DEFAULT(UseAOT));
4618 bool jvmci_enabled = NOT_JVMCI(false) JVMCI_ONLY(EnableJVMCI || UseJVMCICompiler);
4619 bool handshakes_supported = SafepointMechanism::supports_thread_local_poll() && !aot_enabled && !jvmci_enabled && ThreadLocalHandshakes;
4620 // ThreadLocalHandshakesConstraintFunc handles the constraints.
4621 // Here we try to figure out if a mutual exclusive option have been set.
4622 if (handshakes_supported) {
4623 if (FLAG_IS_DEFAULT(UseAOT)) {
4624 FLAG_SET_DEFAULT(UseAOT, false); // Clear the AOT flag to make sure it doesn't try to initialize.
4625 }
4626 } else {
4627 if (FLAG_IS_DEFAULT(ThreadLocalHandshakes) && ThreadLocalHandshakes) {
4628 if (!SafepointMechanism::supports_thread_local_poll()) {
4629 // Unsupported platform should have ThreadLocalHandshakes default set to false.
4630 log_debug(ergo)("Disabling ThreadLocalHandshakes unsupported plaform.");
4631 FLAG_SET_ERGO(bool, ThreadLocalHandshakes, false);
4632 } else if (!FLAG_IS_DEFAULT(UseAOT) && UseAOT) {
4633 // If user enabled AOT but ThreadLocalHandshakes is at default set it to false.
4634 log_debug(ergo)("Disabling ThreadLocalHandshakes for UseAOT.");
4635 FLAG_SET_ERGO(bool, ThreadLocalHandshakes, false);
4636 } else if (jvmci_enabled){
4637 // If user enabled JVMCI but ThreadLocalHandshakes is at default set it to false.
4638 log_debug(ergo)("Disabling ThreadLocalHandshakes for EnableJVMCI/UseJVMCICompiler.");
4639 FLAG_SET_ERGO(bool, ThreadLocalHandshakes, false);
4640 }
4641 }
4642 }
4643 if (FLAG_IS_DEFAULT(ThreadLocalHandshakes) || !SafepointMechanism::supports_thread_local_poll()) {
4644 log_debug(ergo)("ThreadLocalHandshakes %s", ThreadLocalHandshakes ? "enabled." : "disabled.");
4645 } else {
4646 log_info(ergo)("ThreadLocalHandshakes %s", ThreadLocalHandshakes ? "enabled." : "disabled.");
4647 }
4648
4649 return JNI_OK;
4650 }
4651
4652 jint Arguments::adjust_after_os() {
4653 if (UseNUMA) {
4654 if (UseParallelGC || UseParallelOldGC) {
4655 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
4656 FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
4657 }
4658 }
4659 // UseNUMAInterleaving is set to ON for all collectors and
4660 // platforms when UseNUMA is set to ON. NUMA-aware collectors
4661 // such as the parallel collector for Linux and Solaris will
4662 // interleave old gen and survivor spaces on top of NUMA
4663 // allocation policy for the eden space.
4664 // Non NUMA-aware collectors such as CMS, G1 and Serial-GC on
4665 // all platforms and ParallelGC on Windows will interleave all
4666 // of the heap spaces across NUMA nodes.
|