< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page




2094       return false;
2095     }
2096   }
2097 #endif
2098 
2099 #ifndef SUPPORT_RESERVED_STACK_AREA
2100   if (StackReservedPages != 0) {
2101     FLAG_SET_CMDLINE(StackReservedPages, 0);
2102     warning("Reserved Stack Area not supported on this platform");
2103   }
2104 #endif
2105 
2106   if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
2107     if ((UseNUMAInterleaving && !FLAG_IS_DEFAULT(UseNUMAInterleaving)) || (UseNUMA && !FLAG_IS_DEFAULT(UseNUMA))) {
2108       log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n");
2109     }
2110   }
2111 
2112   status = status && GCArguments::check_args_consistency();
2113 








































2114   return status;
2115 }
2116 
2117 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2118   const char* option_type) {
2119   if (ignore) return false;
2120 
2121   const char* spacer = " ";
2122   if (option_type == NULL) {
2123     option_type = ++spacer; // Set both to the empty string.
2124   }
2125 
2126   jio_fprintf(defaultStream::error_stream(),
2127               "Unrecognized %s%soption: %s\n", option_type, spacer,
2128               option->optionString);
2129   return true;
2130 }
2131 
2132 static const char* user_assertion_options[] = {
2133   "-da", "-ea", "-disableassertions", "-enableassertions", 0


2983 #endif // INCLUDE_MANAGEMENT
2984 #if INCLUDE_JFR
2985     } else if (match_jfr_option(&option)) {
2986       return JNI_EINVAL;
2987 #endif
2988     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2989       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
2990       // already been handled
2991       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
2992           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
2993         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2994           return JNI_EINVAL;
2995         }
2996       }
2997     // Unknown option
2998     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2999       return JNI_ERR;
3000     }
3001   }
3002 






3003   // PrintSharedArchiveAndExit will turn on
3004   //   -Xshare:on
3005   //   -Xlog:class+path=info
3006   if (PrintSharedArchiveAndExit) {
3007     if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {
3008       return JNI_EINVAL;
3009     }
3010     if (FLAG_SET_CMDLINE(RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
3011       return JNI_EINVAL;
3012     }
3013     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
3014   }
3015 
3016   fix_appclasspath();
3017 
3018   return JNI_OK;
3019 }
3020 
3021 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
3022   // For java.base check for duplicate --patch-module options being specified on the command line.


4057   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4058   FLAG_SET_DEFAULT(UseBiasedLocking, false);
4059   LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
4060   LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
4061 #endif // CC_INTERP
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 
4079 #ifndef PRODUCT
4080   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4081     if (use_vm_log()) {
4082       LogVMOutput = true;
4083     }
4084   }
4085 #endif // PRODUCT
4086 
4087   if (PrintCommandLineFlags) {
4088     JVMFlag::printSetFlags(tty);
4089   }
4090 
4091   // Apply CPU specific policy for the BiasedLocking
4092   if (UseBiasedLocking) {
4093     if (!VM_Version::use_biased_locking() &&
4094         !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4095       UseBiasedLocking = false;
4096     }




2094       return false;
2095     }
2096   }
2097 #endif
2098 
2099 #ifndef SUPPORT_RESERVED_STACK_AREA
2100   if (StackReservedPages != 0) {
2101     FLAG_SET_CMDLINE(StackReservedPages, 0);
2102     warning("Reserved Stack Area not supported on this platform");
2103   }
2104 #endif
2105 
2106   if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
2107     if ((UseNUMAInterleaving && !FLAG_IS_DEFAULT(UseNUMAInterleaving)) || (UseNUMA && !FLAG_IS_DEFAULT(UseNUMA))) {
2108       log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n");
2109     }
2110   }
2111 
2112   status = status && GCArguments::check_args_consistency();
2113 
2114   if (AMD64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypePassFieldsAsArgs)) {
2115     FLAG_SET_CMDLINE(ValueTypePassFieldsAsArgs, false);
2116     warning("ValueTypePassFieldsAsArgs is not supported on this platform");
2117   }
2118 
2119   if (AMD64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypeReturnedAsFields)) {
2120     FLAG_SET_CMDLINE(ValueTypeReturnedAsFields, false);
2121     warning("ValueTypeReturnedAsFields is not supported on this platform");
2122   }
2123 
2124   if (EnableValhalla) {
2125     if (!TieredCompilation) {
2126       if (!FLAG_IS_DEFAULT(EnableValhallaC1) && EnableValhallaC1) {
2127         warning("EnableValhallaC1 is disabled because TieredCompilation is disabled");
2128       }
2129       FLAG_SET_CMDLINE(EnableValhallaC1, false);
2130       if (!FLAG_IS_DEFAULT(TieredStopAtLevel) && TieredStopAtLevel != 4) {
2131         warning("TieredStopAtLevel is reset to 4 because TieredCompilation is disabled");
2132       }
2133       FLAG_SET_CMDLINE(TieredStopAtLevel, 4);
2134     }
2135     if (!EnableValhallaC1) {
2136       // C1 support for value types is incomplete. Don't use it by default.
2137       if (!FLAG_IS_DEFAULT(TieredCompilation) && TieredCompilation) {
2138         warning("TieredCompilation disabled because value types are not fully supported by C1");
2139       }
2140       FLAG_SET_CMDLINE(TieredCompilation, false);
2141     } else {
2142       /*
2143         TEMP: to run the valuetype tests with C1, you need to use the following command-line:
2144 
2145         cd test/hotspot/jtreg/compiler/valhalla/valuetypes
2146         jtreg \
2147             -javaoption:-XX:+EnableValhallaC1 \
2148             -javaoption:-XX:TieredStopAtLevel=1 \
2149             .
2150 
2151       */
2152     }
2153   }
2154   return status;
2155 }
2156 
2157 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2158   const char* option_type) {
2159   if (ignore) return false;
2160 
2161   const char* spacer = " ";
2162   if (option_type == NULL) {
2163     option_type = ++spacer; // Set both to the empty string.
2164   }
2165 
2166   jio_fprintf(defaultStream::error_stream(),
2167               "Unrecognized %s%soption: %s\n", option_type, spacer,
2168               option->optionString);
2169   return true;
2170 }
2171 
2172 static const char* user_assertion_options[] = {
2173   "-da", "-ea", "-disableassertions", "-enableassertions", 0


3023 #endif // INCLUDE_MANAGEMENT
3024 #if INCLUDE_JFR
3025     } else if (match_jfr_option(&option)) {
3026       return JNI_EINVAL;
3027 #endif
3028     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3029       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
3030       // already been handled
3031       if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
3032           (strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
3033         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3034           return JNI_EINVAL;
3035         }
3036       }
3037     // Unknown option
3038     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
3039       return JNI_ERR;
3040     }
3041   }
3042 
3043   if (EnableValhalla) {
3044     if (!create_property("valhalla.enableValhalla", "true", InternalProperty)) {
3045       return JNI_ENOMEM;
3046     }
3047   }
3048 
3049   // PrintSharedArchiveAndExit will turn on
3050   //   -Xshare:on
3051   //   -Xlog:class+path=info
3052   if (PrintSharedArchiveAndExit) {
3053     if (FLAG_SET_CMDLINE(UseSharedSpaces, true) != JVMFlag::SUCCESS) {
3054       return JNI_EINVAL;
3055     }
3056     if (FLAG_SET_CMDLINE(RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
3057       return JNI_EINVAL;
3058     }
3059     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
3060   }
3061 
3062   fix_appclasspath();
3063 
3064   return JNI_OK;
3065 }
3066 
3067 void Arguments::add_patch_mod_prefix(const char* module_name, const char* path, bool* patch_mod_javabase) {
3068   // For java.base check for duplicate --patch-module options being specified on the command line.


4103   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4104   FLAG_SET_DEFAULT(UseBiasedLocking, false);
4105   LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
4106   LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
4107 #endif // CC_INTERP
4108 
4109   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4110     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4111     DebugNonSafepoints = true;
4112   }
4113 
4114   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4115     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4116   }
4117 
4118   // Treat the odd case where local verification is enabled but remote
4119   // verification is not as if both were enabled.
4120   if (BytecodeVerificationLocal && !BytecodeVerificationRemote) {
4121     log_info(verification)("Turning on remote verification because local verification is on");
4122     FLAG_SET_DEFAULT(BytecodeVerificationRemote, true);
4123   }
4124   if (!EnableValhalla || is_interpreter_only()) {
4125     // Disable calling convention optimizations if value types are not supported
4126     ValueTypePassFieldsAsArgs = false;
4127     ValueTypeReturnedAsFields = false;
4128   }
4129 
4130 #ifndef PRODUCT
4131   if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
4132     if (use_vm_log()) {
4133       LogVMOutput = true;
4134     }
4135   }
4136 #endif // PRODUCT
4137 
4138   if (PrintCommandLineFlags) {
4139     JVMFlag::printSetFlags(tty);
4140   }
4141 
4142   // Apply CPU specific policy for the BiasedLocking
4143   if (UseBiasedLocking) {
4144     if (!VM_Version::use_biased_locking() &&
4145         !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4146       UseBiasedLocking = false;
4147     }


< prev index next >