< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

2068   }
2069 
2070   status = CompilerConfig::check_args_consistency(status);
2071 #if INCLUDE_JVMCI
2072   if (status && EnableJVMCI) {
2073     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
2074         AddProperty, UnwriteableProperty, InternalProperty);
2075     if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2076       return false;
2077     }
2078   }
2079 #endif
2080 
2081 #ifndef SUPPORT_RESERVED_STACK_AREA
2082   if (StackReservedPages != 0) {
2083     FLAG_SET_CMDLINE(StackReservedPages, 0);
2084     warning("Reserved Stack Area not supported on this platform");
2085   }
2086 #endif
2087 










2088 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64)
2089   if (UseHeavyMonitors) {
2090     jio_fprintf(defaultStream::error_stream(),
2091                 "UseHeavyMonitors is not fully implemented on this architecture");
2092     return false;
2093   }
2094 #endif
2095 #if (defined(X86) || defined(PPC64)) && !defined(ZERO)
2096   if (UseHeavyMonitors && UseRTMForStackLocks) {
2097     jio_fprintf(defaultStream::error_stream(),
2098                 "-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive");
2099 
2100     return false;
2101   }
2102 #endif
2103   if (VerifyHeavyMonitors && !UseHeavyMonitors) {
2104     jio_fprintf(defaultStream::error_stream(),
2105                 "-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors");
2106     return false;
2107   }

3025 #endif // INCLUDE_JVMCI
3026 #if INCLUDE_JFR
3027     } else if (match_jfr_option(&option)) {
3028       return JNI_EINVAL;
3029 #endif
3030     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3031       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
3032       // already been handled
3033       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
3034           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
3035         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3036           return JNI_EINVAL;
3037         }
3038       }
3039     // Unknown option
3040     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
3041       return JNI_ERR;
3042     }
3043   }
3044 


















3045   // PrintSharedArchiveAndExit will turn on
3046   //   -Xshare:on
3047   //   -Xlog:class+path=info
3048   if (PrintSharedArchiveAndExit) {
3049     UseSharedSpaces = true;
3050     RequireSharedSpaces = true;
3051     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
3052   }
3053 
3054   fix_appclasspath();
3055 
3056   return JNI_OK;
3057 }
3058 
3059 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
3060   // For java.base check for duplicate --patch-module options being specified on the command line.
3061   // This check is only required for java.base, all other duplicate module specifications
3062   // will be checked during module system initialization.  The module system initialization
3063   // will throw an ExceptionInInitializerError if this situation occurs.
3064   if (strcmp(module_name, JAVA_BASE_NAME) == 0) {

4169     warning("LogTouchedMethods is not supported for Zero");
4170     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4171   }
4172 #endif // ZERO
4173 
4174   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4175     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4176     DebugNonSafepoints = true;
4177   }
4178 
4179   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4180     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4181   }
4182 
4183   // Treat the odd case where local verification is enabled but remote
4184   // verification is not as if both were enabled.
4185   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4186     log_info(verification)("Turning on remote verification because local verification is on");
4187     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4188   }







4189 
4190 #ifndef PRODUCT
4191   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4192     if (use_vm_log()) {
4193       LogVMOutput = true;
4194     }
4195   }
4196 #endif // PRODUCT
4197 
4198   if (PrintCommandLineFlags) {
4199     JVMFlag::printSetFlags(tty);
4200   }
4201 
4202 #ifdef COMPILER2
4203   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4204     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4205       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4206     }
4207     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4208 

2068   }
2069 
2070   status = CompilerConfig::check_args_consistency(status);
2071 #if INCLUDE_JVMCI
2072   if (status && EnableJVMCI) {
2073     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
2074         AddProperty, UnwriteableProperty, InternalProperty);
2075     if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2076       return false;
2077     }
2078   }
2079 #endif
2080 
2081 #ifndef SUPPORT_RESERVED_STACK_AREA
2082   if (StackReservedPages != 0) {
2083     FLAG_SET_CMDLINE(StackReservedPages, 0);
2084     warning("Reserved Stack Area not supported on this platform");
2085   }
2086 #endif
2087 
2088   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypePassFieldsAsArgs)) {
2089     FLAG_SET_CMDLINE(InlineTypePassFieldsAsArgs, false);
2090     warning("InlineTypePassFieldsAsArgs is not supported on this platform");
2091   }
2092 
2093   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypeReturnedAsFields)) {
2094     FLAG_SET_CMDLINE(InlineTypeReturnedAsFields, false);
2095     warning("InlineTypeReturnedAsFields is not supported on this platform");
2096   }
2097 
2098 #if !defined(X86) && !defined(AARCH64) && !defined(PPC64)
2099   if (UseHeavyMonitors) {
2100     jio_fprintf(defaultStream::error_stream(),
2101                 "UseHeavyMonitors is not fully implemented on this architecture");
2102     return false;
2103   }
2104 #endif
2105 #if (defined(X86) || defined(PPC64)) && !defined(ZERO)
2106   if (UseHeavyMonitors && UseRTMForStackLocks) {
2107     jio_fprintf(defaultStream::error_stream(),
2108                 "-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive");
2109 
2110     return false;
2111   }
2112 #endif
2113   if (VerifyHeavyMonitors && !UseHeavyMonitors) {
2114     jio_fprintf(defaultStream::error_stream(),
2115                 "-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors");
2116     return false;
2117   }

3035 #endif // INCLUDE_JVMCI
3036 #if INCLUDE_JFR
3037     } else if (match_jfr_option(&option)) {
3038       return JNI_EINVAL;
3039 #endif
3040     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3041       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
3042       // already been handled
3043       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
3044           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
3045         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3046           return JNI_EINVAL;
3047         }
3048       }
3049     // Unknown option
3050     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
3051       return JNI_ERR;
3052     }
3053   }
3054 
3055   if (EnableValhalla) {
3056     // create_property("valhalla.enableValhalla", "true", InternalProperty)
3057     const char* prop_name = "valhalla.enableValhalla";
3058     const char* prop_value = "true";
3059     const size_t prop_len = strlen(prop_name) + strlen(prop_value) + 2;
3060     char* property = AllocateHeap(prop_len, mtArguments);
3061     int ret = jio_snprintf(property, prop_len, "%s=%s", prop_name, prop_value);
3062     if (ret < 0 || ret >= (int)prop_len) {
3063       FreeHeap(property);
3064       return JNI_ENOMEM;
3065     }
3066     bool added = add_property(property, UnwriteableProperty, InternalProperty);
3067     FreeHeap(property);
3068     if (!added) {
3069       return JNI_ENOMEM;
3070     }
3071   }
3072 
3073   // PrintSharedArchiveAndExit will turn on
3074   //   -Xshare:on
3075   //   -Xlog:class+path=info
3076   if (PrintSharedArchiveAndExit) {
3077     UseSharedSpaces = true;
3078     RequireSharedSpaces = true;
3079     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
3080   }
3081 
3082   fix_appclasspath();
3083 
3084   return JNI_OK;
3085 }
3086 
3087 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
3088   // For java.base check for duplicate --patch-module options being specified on the command line.
3089   // This check is only required for java.base, all other duplicate module specifications
3090   // will be checked during module system initialization.  The module system initialization
3091   // will throw an ExceptionInInitializerError if this situation occurs.
3092   if (strcmp(module_name, JAVA_BASE_NAME) == 0) {

4197     warning("LogTouchedMethods is not supported for Zero");
4198     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4199   }
4200 #endif // ZERO
4201 
4202   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4203     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4204     DebugNonSafepoints = true;
4205   }
4206 
4207   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4208     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4209   }
4210 
4211   // Treat the odd case where local verification is enabled but remote
4212   // verification is not as if both were enabled.
4213   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4214     log_info(verification)("Turning on remote verification because local verification is on");
4215     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4216   }
4217   if (!EnableValhalla || (is_interpreter_only() && !is_dumping_archive() && !UseSharedSpaces)) {
4218     // Disable calling convention optimizations if inline types are not supported.
4219     // Also these aren't useful in -Xint. However, don't disable them when dumping or using
4220     // the CDS archive, as the values must match between dumptime and runtime.
4221     InlineTypePassFieldsAsArgs = false;
4222     InlineTypeReturnedAsFields = false;
4223   }
4224 
4225 #ifndef PRODUCT
4226   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4227     if (use_vm_log()) {
4228       LogVMOutput = true;
4229     }
4230   }
4231 #endif // PRODUCT
4232 
4233   if (PrintCommandLineFlags) {
4234     JVMFlag::printSetFlags(tty);
4235   }
4236 
4237 #ifdef COMPILER2
4238   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4239     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4240       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4241     }
4242     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4243 
< prev index next >