< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

2001   }
2002 
2003   status = CompilerConfig::check_args_consistency(status);
2004 #if INCLUDE_JVMCI
2005   if (status && EnableJVMCI) {
2006     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
2007         AddProperty, UnwriteableProperty, InternalProperty);
2008     if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2009       return false;
2010     }
2011   }
2012 #endif
2013 
2014 #ifndef SUPPORT_RESERVED_STACK_AREA
2015   if (StackReservedPages != 0) {
2016     FLAG_SET_CMDLINE(StackReservedPages, 0);
2017     warning("Reserved Stack Area not supported on this platform");
2018   }
2019 #endif
2020 










2021   return status;
2022 }
2023 
2024 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2025   const char* option_type) {
2026   if (ignore) return false;
2027 
2028   const char* spacer = " ";
2029   if (option_type == NULL) {
2030     option_type = ++spacer; // Set both to the empty string.
2031   }
2032 
2033   jio_fprintf(defaultStream::error_stream(),
2034               "Unrecognized %s%soption: %s\n", option_type, spacer,
2035               option->optionString);
2036   return true;
2037 }
2038 
2039 static const char* user_assertion_options[] = {
2040   "-da", "-ea", "-disableassertions", "-enableassertions", 0

2933 #endif // INCLUDE_JVMCI
2934 #if INCLUDE_JFR
2935     } else if (match_jfr_option(&option)) {
2936       return JNI_EINVAL;
2937 #endif
2938     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2939       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
2940       // already been handled
2941       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
2942           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
2943         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2944           return JNI_EINVAL;
2945         }
2946       }
2947     // Unknown option
2948     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2949       return JNI_ERR;
2950     }
2951   }
2952 


















2953   // PrintSharedArchiveAndExit will turn on
2954   //   -Xshare:on
2955   //   -Xlog:class+path=info
2956   if (PrintSharedArchiveAndExit) {
2957     if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {
2958       return JNI_EINVAL;
2959     }
2960     if (FLAG_SET_CMDLINE(RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
2961       return JNI_EINVAL;
2962     }
2963     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
2964   }
2965 
2966   fix_appclasspath();
2967 
2968   return JNI_OK;
2969 }
2970 
2971 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
2972   // For java.base check for duplicate --patch-module options being specified on the command line.

4051     warning("LogTouchedMethods is not supported for Zero");
4052     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4053   }
4054 #endif // ZERO
4055 
4056   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4057     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4058     DebugNonSafepoints = true;
4059   }
4060 
4061   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4062     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4063   }
4064 
4065   // Treat the odd case where local verification is enabled but remote
4066   // verification is not as if both were enabled.
4067   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4068     log_info(verification)("Turning on remote verification because local verification is on");
4069     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4070   }







4071 
4072 #ifndef PRODUCT
4073   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4074     if (use_vm_log()) {
4075       LogVMOutput = true;
4076     }
4077   }
4078 #endif // PRODUCT
4079 
4080   if (PrintCommandLineFlags) {
4081     JVMFlag::printSetFlags(tty);
4082   }
4083 
4084 #ifdef COMPILER2
4085   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4086     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4087       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4088     }
4089     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4090 

2001   }
2002 
2003   status = CompilerConfig::check_args_consistency(status);
2004 #if INCLUDE_JVMCI
2005   if (status && EnableJVMCI) {
2006     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
2007         AddProperty, UnwriteableProperty, InternalProperty);
2008     if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2009       return false;
2010     }
2011   }
2012 #endif
2013 
2014 #ifndef SUPPORT_RESERVED_STACK_AREA
2015   if (StackReservedPages != 0) {
2016     FLAG_SET_CMDLINE(StackReservedPages, 0);
2017     warning("Reserved Stack Area not supported on this platform");
2018   }
2019 #endif
2020 
2021   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypePassFieldsAsArgs)) {
2022     FLAG_SET_CMDLINE(InlineTypePassFieldsAsArgs, false);
2023     warning("InlineTypePassFieldsAsArgs is not supported on this platform");
2024   }
2025 
2026   if (AMD64_ONLY(false &&) AARCH64_ONLY(false &&) !FLAG_IS_DEFAULT(InlineTypeReturnedAsFields)) {
2027     FLAG_SET_CMDLINE(InlineTypeReturnedAsFields, false);
2028     warning("InlineTypeReturnedAsFields is not supported on this platform");
2029   }
2030 
2031   return status;
2032 }
2033 
2034 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2035   const char* option_type) {
2036   if (ignore) return false;
2037 
2038   const char* spacer = " ";
2039   if (option_type == NULL) {
2040     option_type = ++spacer; // Set both to the empty string.
2041   }
2042 
2043   jio_fprintf(defaultStream::error_stream(),
2044               "Unrecognized %s%soption: %s\n", option_type, spacer,
2045               option->optionString);
2046   return true;
2047 }
2048 
2049 static const char* user_assertion_options[] = {
2050   "-da", "-ea", "-disableassertions", "-enableassertions", 0

2943 #endif // INCLUDE_JVMCI
2944 #if INCLUDE_JFR
2945     } else if (match_jfr_option(&option)) {
2946       return JNI_EINVAL;
2947 #endif
2948     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2949       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
2950       // already been handled
2951       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
2952           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
2953         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2954           return JNI_EINVAL;
2955         }
2956       }
2957     // Unknown option
2958     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2959       return JNI_ERR;
2960     }
2961   }
2962 
2963   if (EnableValhalla) {
2964     // create_property("valhalla.enableValhalla", "true", InternalProperty)
2965     const char* prop_name = "valhalla.enableValhalla";
2966     const char* prop_value = "true";
2967     const size_t prop_len = strlen(prop_name) + strlen(prop_value) + 2;
2968     char* property = AllocateHeap(prop_len, mtArguments);
2969     int ret = jio_snprintf(property, prop_len, "%s=%s", prop_name, prop_value);
2970     if (ret < 0 || ret >= (int)prop_len) {
2971       FreeHeap(property);
2972       return JNI_ENOMEM;
2973     }
2974     bool added = add_property(property, UnwriteableProperty, InternalProperty);
2975     FreeHeap(property);
2976     if (!added) {
2977       return JNI_ENOMEM;
2978     }
2979   }
2980 
2981   // PrintSharedArchiveAndExit will turn on
2982   //   -Xshare:on
2983   //   -Xlog:class+path=info
2984   if (PrintSharedArchiveAndExit) {
2985     if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {
2986       return JNI_EINVAL;
2987     }
2988     if (FLAG_SET_CMDLINE(RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
2989       return JNI_EINVAL;
2990     }
2991     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
2992   }
2993 
2994   fix_appclasspath();
2995 
2996   return JNI_OK;
2997 }
2998 
2999 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
3000   // For java.base check for duplicate --patch-module options being specified on the command line.

4079     warning("LogTouchedMethods is not supported for Zero");
4080     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4081   }
4082 #endif // ZERO
4083 
4084   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4085     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4086     DebugNonSafepoints = true;
4087   }
4088 
4089   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4090     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4091   }
4092 
4093   // Treat the odd case where local verification is enabled but remote
4094   // verification is not as if both were enabled.
4095   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4096     log_info(verification)("Turning on remote verification because local verification is on");
4097     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4098   }
4099   if (!EnableValhalla || (is_interpreter_only() && !is_dumping_archive() && !UseSharedSpaces)) {
4100     // Disable calling convention optimizations if inline types are not supported.
4101     // Also these aren't useful in -Xint. However, don't disable them when dumping or using
4102     // the CDS archive, as the values must match between dumptime and runtime.
4103     InlineTypePassFieldsAsArgs = false;
4104     InlineTypeReturnedAsFields = false;
4105   }
4106 
4107 #ifndef PRODUCT
4108   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4109     if (use_vm_log()) {
4110       LogVMOutput = true;
4111     }
4112   }
4113 #endif // PRODUCT
4114 
4115   if (PrintCommandLineFlags) {
4116     JVMFlag::printSetFlags(tty);
4117   }
4118 
4119 #ifdef COMPILER2
4120   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4121     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4122       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4123     }
4124     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4125 
< prev index next >