1901 if (StackReservedPages != 0) {
1902 FLAG_SET_CMDLINE(StackReservedPages, 0);
1903 warning("Reserved Stack Area not supported on this platform");
1904 }
1905 #endif
1906
1907 #if !defined(X86) && !defined(AARCH64) && !defined(RISCV64) && !defined(ARM) && !defined(PPC64) && !defined(S390)
1908 if (LockingMode == LM_LIGHTWEIGHT) {
1909 FLAG_SET_CMDLINE(LockingMode, LM_LEGACY);
1910 warning("New lightweight locking not supported on this platform");
1911 }
1912 #endif
1913
1914 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64) && !defined(RISCV64) && !defined(S390)
1915 if (LockingMode == LM_MONITOR) {
1916 jio_fprintf(defaultStream::error_stream(),
1917 "LockingMode == 0 (LM_MONITOR) is not fully implemented on this architecture");
1918 return false;
1919 }
1920 #endif
1921 #if (defined(X86) || defined(PPC64)) && !defined(ZERO)
1922 if (LockingMode == LM_MONITOR && UseRTMForStackLocks) {
1923 jio_fprintf(defaultStream::error_stream(),
1924 "LockingMode == 0 (LM_MONITOR) and -XX:+UseRTMForStackLocks are mutually exclusive");
1925
1926 return false;
1927 }
1928 #endif
1929 if (VerifyHeavyMonitors && LockingMode != LM_MONITOR) {
1930 jio_fprintf(defaultStream::error_stream(),
1931 "-XX:+VerifyHeavyMonitors requires LockingMode == 0 (LM_MONITOR)");
1932 return false;
1933 }
1934 return status;
1935 }
1936
1937 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
1938 const char* option_type) {
1939 if (ignore) return false;
1940
1941 const char* spacer = " ";
3068 if (UseSharedSpaces && patch_mod_javabase) {
3069 no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched.");
3070 }
3071 if (UseSharedSpaces && !DumpSharedSpaces && check_unsupported_cds_runtime_properties()) {
3072 UseSharedSpaces = false;
3073 }
3074
3075 if (DumpSharedSpaces || DynamicDumpSharedSpaces) {
3076 // Always verify non-system classes during CDS dump
3077 if (!BytecodeVerificationRemote) {
3078 BytecodeVerificationRemote = true;
3079 log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time.");
3080 }
3081 }
3082 #endif
3083
3084 #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
3085 UNSUPPORTED_OPTION(ShowRegistersOnAssert);
3086 #endif // CAN_SHOW_REGISTERS_ON_ASSERT
3087
3088 return JNI_OK;
3089 }
3090
3091 // Helper class for controlling the lifetime of JavaVMInitArgs
3092 // objects. The contents of the JavaVMInitArgs are guaranteed to be
3093 // deleted on the destruction of the ScopedVMInitArgs object.
3094 class ScopedVMInitArgs : public StackObj {
3095 private:
3096 JavaVMInitArgs _args;
3097 char* _container_name;
3098 bool _is_set;
3099 char* _vm_options_file_arg;
3100
3101 public:
3102 ScopedVMInitArgs(const char *container_name) {
3103 _args.version = JNI_VERSION_1_2;
3104 _args.nOptions = 0;
3105 _args.options = nullptr;
3106 _args.ignoreUnrecognized = false;
3107 _container_name = (char *)container_name;
|
1901 if (StackReservedPages != 0) {
1902 FLAG_SET_CMDLINE(StackReservedPages, 0);
1903 warning("Reserved Stack Area not supported on this platform");
1904 }
1905 #endif
1906
1907 #if !defined(X86) && !defined(AARCH64) && !defined(RISCV64) && !defined(ARM) && !defined(PPC64) && !defined(S390)
1908 if (LockingMode == LM_LIGHTWEIGHT) {
1909 FLAG_SET_CMDLINE(LockingMode, LM_LEGACY);
1910 warning("New lightweight locking not supported on this platform");
1911 }
1912 #endif
1913
1914 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64) && !defined(RISCV64) && !defined(S390)
1915 if (LockingMode == LM_MONITOR) {
1916 jio_fprintf(defaultStream::error_stream(),
1917 "LockingMode == 0 (LM_MONITOR) is not fully implemented on this architecture");
1918 return false;
1919 }
1920 #endif
1921 #if defined(X86) && !defined(ZERO)
1922 if (LockingMode == LM_MONITOR && UseRTMForStackLocks) {
1923 jio_fprintf(defaultStream::error_stream(),
1924 "LockingMode == 0 (LM_MONITOR) and -XX:+UseRTMForStackLocks are mutually exclusive");
1925
1926 return false;
1927 }
1928 #endif
1929 if (VerifyHeavyMonitors && LockingMode != LM_MONITOR) {
1930 jio_fprintf(defaultStream::error_stream(),
1931 "-XX:+VerifyHeavyMonitors requires LockingMode == 0 (LM_MONITOR)");
1932 return false;
1933 }
1934 return status;
1935 }
1936
1937 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
1938 const char* option_type) {
1939 if (ignore) return false;
1940
1941 const char* spacer = " ";
3068 if (UseSharedSpaces && patch_mod_javabase) {
3069 no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched.");
3070 }
3071 if (UseSharedSpaces && !DumpSharedSpaces && check_unsupported_cds_runtime_properties()) {
3072 UseSharedSpaces = false;
3073 }
3074
3075 if (DumpSharedSpaces || DynamicDumpSharedSpaces) {
3076 // Always verify non-system classes during CDS dump
3077 if (!BytecodeVerificationRemote) {
3078 BytecodeVerificationRemote = true;
3079 log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time.");
3080 }
3081 }
3082 #endif
3083
3084 #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
3085 UNSUPPORTED_OPTION(ShowRegistersOnAssert);
3086 #endif // CAN_SHOW_REGISTERS_ON_ASSERT
3087
3088 #ifdef _LP64
3089 if (UseCompactObjectHeaders && UseZGC && !ZGenerational) {
3090 if (FLAG_IS_CMDLINE(UseCompactObjectHeaders)) {
3091 warning("Single-generational ZGC does not work with compact object headers, disabling UseCompactObjectHeaders");
3092 }
3093 FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
3094 }
3095 if (UseCompactObjectHeaders && FLAG_IS_CMDLINE(UseCompressedClassPointers) && !UseCompressedClassPointers) {
3096 warning("Compact object headers require compressed class pointers. Disabling compact object headers.");
3097 FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
3098 }
3099 if (UseCompactObjectHeaders && LockingMode == LM_LEGACY) {
3100 FLAG_SET_DEFAULT(LockingMode, LM_LIGHTWEIGHT);
3101 }
3102 if (UseCompactObjectHeaders && !UseAltGCForwarding) {
3103 FLAG_SET_DEFAULT(UseAltGCForwarding, true);
3104 }
3105 if (UseCompactObjectHeaders && !UseCompressedClassPointers) {
3106 FLAG_SET_DEFAULT(UseCompressedClassPointers, true);
3107 }
3108 #endif
3109
3110 return JNI_OK;
3111 }
3112
3113 // Helper class for controlling the lifetime of JavaVMInitArgs
3114 // objects. The contents of the JavaVMInitArgs are guaranteed to be
3115 // deleted on the destruction of the ScopedVMInitArgs object.
3116 class ScopedVMInitArgs : public StackObj {
3117 private:
3118 JavaVMInitArgs _args;
3119 char* _container_name;
3120 bool _is_set;
3121 char* _vm_options_file_arg;
3122
3123 public:
3124 ScopedVMInitArgs(const char *container_name) {
3125 _args.version = JNI_VERSION_1_2;
3126 _args.nOptions = 0;
3127 _args.options = nullptr;
3128 _args.ignoreUnrecognized = false;
3129 _container_name = (char *)container_name;
|