867 // setting during arguments processing. See use_biased_locking().
868 // VM_Version_init() is executed after UseBiasedLocking is used
869 // in Thread::allocate().
870 vm_exit_during_initialization("RTM instructions are not available on this CPU");
871 }
872
873 #if INCLUDE_RTM_OPT
874 if (UseRTMLocking) {
875 if (is_client_compilation_mode_vm()) {
876 // Only C2 does RTM locking optimization.
877 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
878 // setting during arguments processing. See use_biased_locking().
879 vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM");
880 }
881 if (is_intel_family_core()) {
882 if ((_model == CPU_MODEL_HASWELL_E3) ||
883 (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) ||
884 (_model == CPU_MODEL_BROADWELL && _stepping < 4)) {
885 // currently a collision between SKL and HSW_E3
886 if (!UnlockExperimentalVMOptions && UseAVX < 3) {
887 vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag.");
888 } else {
889 warning("UseRTMLocking is only available as experimental option on this platform.");
890 }
891 }
892 }
893 if (!FLAG_IS_CMDLINE(UseRTMLocking)) {
894 // RTM locking should be used only for applications with
895 // high lock contention. For now we do not use it by default.
896 vm_exit_during_initialization("UseRTMLocking flag should be only set on command line");
897 }
898 if (!is_power_of_2(RTMTotalCountIncrRate)) {
899 warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64");
900 FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
901 }
902 if (RTMAbortRatio < 0 || RTMAbortRatio > 100) {
903 warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50");
904 FLAG_SET_DEFAULT(RTMAbortRatio, 50);
905 }
906 } else { // !UseRTMLocking
907 if (UseRTMForStackLocks) {
908 if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) {
909 warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off");
910 }
911 FLAG_SET_DEFAULT(UseRTMForStackLocks, false);
912 }
913 if (UseRTMDeopt) {
914 FLAG_SET_DEFAULT(UseRTMDeopt, false);
915 }
916 if (PrintPreciseRTMLockingStatistics) {
917 FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false);
918 }
919 }
920 #else
921 if (UseRTMLocking) {
922 // Only C2 does RTM locking optimization.
923 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
924 // setting during arguments processing. See use_biased_locking().
|
867 // setting during arguments processing. See use_biased_locking().
868 // VM_Version_init() is executed after UseBiasedLocking is used
869 // in Thread::allocate().
870 vm_exit_during_initialization("RTM instructions are not available on this CPU");
871 }
872
873 #if INCLUDE_RTM_OPT
874 if (UseRTMLocking) {
875 if (is_client_compilation_mode_vm()) {
876 // Only C2 does RTM locking optimization.
877 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
878 // setting during arguments processing. See use_biased_locking().
879 vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM");
880 }
881 if (is_intel_family_core()) {
882 if ((_model == CPU_MODEL_HASWELL_E3) ||
883 (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) ||
884 (_model == CPU_MODEL_BROADWELL && _stepping < 4)) {
885 // currently a collision between SKL and HSW_E3
886 if (!UnlockExperimentalVMOptions && UseAVX < 3) {
887 vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this "
888 "platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag.");
889 } else {
890 warning("UseRTMLocking is only available as experimental option on this platform.");
891 }
892 }
893 }
894 if (!FLAG_IS_CMDLINE(UseRTMLocking)) {
895 // RTM locking should be used only for applications with
896 // high lock contention. For now we do not use it by default.
897 vm_exit_during_initialization("UseRTMLocking flag should be only set on command line");
898 }
899 } else { // !UseRTMLocking
900 if (UseRTMForStackLocks) {
901 if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) {
902 warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off");
903 }
904 FLAG_SET_DEFAULT(UseRTMForStackLocks, false);
905 }
906 if (UseRTMDeopt) {
907 FLAG_SET_DEFAULT(UseRTMDeopt, false);
908 }
909 if (PrintPreciseRTMLockingStatistics) {
910 FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false);
911 }
912 }
913 #else
914 if (UseRTMLocking) {
915 // Only C2 does RTM locking optimization.
916 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
917 // setting during arguments processing. See use_biased_locking().
|