< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

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










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

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


















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

4030     warning("LogTouchedMethods is not supported for Zero");
4031     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4032   }
4033 #endif // ZERO
4034 
4035   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4036     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4037     DebugNonSafepoints = true;
4038   }
4039 
4040   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4041     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4042   }
4043 
4044   // Treat the odd case where local verification is enabled but remote
4045   // verification is not as if both were enabled.
4046   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4047     log_info(verification)("Turning on remote verification because local verification is on");
4048     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4049   }







4050 
4051 #ifndef PRODUCT
4052   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4053     if (use_vm_log()) {
4054       LogVMOutput = true;
4055     }
4056   }
4057 #endif // PRODUCT
4058 
4059   if (PrintCommandLineFlags) {
4060     JVMFlag::printSetFlags(tty);
4061   }
4062 
4063 #ifdef COMPILER2
4064   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4065     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4066       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4067     }
4068     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4069 

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

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

4058     warning("LogTouchedMethods is not supported for Zero");
4059     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4060   }
4061 #endif // ZERO
4062 
4063   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4064     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4065     DebugNonSafepoints = true;
4066   }
4067 
4068   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4069     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4070   }
4071 
4072   // Treat the odd case where local verification is enabled but remote
4073   // verification is not as if both were enabled.
4074   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4075     log_info(verification)("Turning on remote verification because local verification is on");
4076     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4077   }
4078   if (!EnableValhalla || (is_interpreter_only() && !is_dumping_archive() && !UseSharedSpaces)) {
4079     // Disable calling convention optimizations if inline types are not supported.
4080     // Also these aren't useful in -Xint. However, don't disable them when dumping or using
4081     // the CDS archive, as the values must match between dumptime and runtime.
4082     InlineTypePassFieldsAsArgs = false;
4083     InlineTypeReturnedAsFields = false;
4084   }
4085 
4086 #ifndef PRODUCT
4087   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4088     if (use_vm_log()) {
4089       LogVMOutput = true;
4090     }
4091   }
4092 #endif // PRODUCT
4093 
4094   if (PrintCommandLineFlags) {
4095     JVMFlag::printSetFlags(tty);
4096   }
4097 
4098 #ifdef COMPILER2
4099   if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
4100     if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
4101       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
4102     }
4103     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
4104 
< prev index next >