src/share/vm/runtime/arguments.cpp

Print this page
rev 4555 : Moved check: ReservedCodeCacheSize >= InitialCodeCacheSize to Arguments::check_vm_args_consistency()
As a result, the order in which the two arguments are passed is irrelevant.


2071     // use for experimentation and debugging.
2072     if (VM_Version::is_sun4v() && UseMemSetInBOT) {
2073       assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
2074       warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
2075           " on sun4v; please understand that you are using at your own risk!");
2076     }
2077   }
2078 #endif // SPARC
2079 
2080   if (PrintNMTStatistics) {
2081 #if INCLUDE_NMT
2082     if (MemTracker::tracking_level() == MemTracker::NMT_off) {
2083 #endif // INCLUDE_NMT
2084       warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2085       PrintNMTStatistics = false;
2086 #if INCLUDE_NMT
2087     }
2088 #endif
2089   }
2090 







2091   return status;
2092 }
2093 
2094 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2095   const char* option_type) {
2096   if (ignore) return false;
2097 
2098   const char* spacer = " ";
2099   if (option_type == NULL) {
2100     option_type = ++spacer; // Set both to the empty string.
2101   }
2102 
2103   if (os::obsolete_option(option)) {
2104     jio_fprintf(defaultStream::error_stream(),
2105                 "Obsolete %s%soption: %s\n", option_type, spacer,
2106       option->optionString);
2107     return false;
2108   } else {
2109     jio_fprintf(defaultStream::error_stream(),
2110                 "Unrecognized %s%soption: %s\n", option_type, spacer,


2423     // -Xss
2424     } else if (match_option(option, "-Xss", &tail)) {
2425       julong long_ThreadStackSize = 0;
2426       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2427       if (errcode != arg_in_range) {
2428         jio_fprintf(defaultStream::error_stream(),
2429                     "Invalid thread stack size: %s\n", option->optionString);
2430         describe_range_error(errcode);
2431         return JNI_EINVAL;
2432       }
2433       // Internally track ThreadStackSize in units of 1024 bytes.
2434       FLAG_SET_CMDLINE(intx, ThreadStackSize,
2435                               round_to((int)long_ThreadStackSize, K) / K);
2436     // -Xoss
2437     } else if (match_option(option, "-Xoss", &tail)) {
2438           // HotSpot does not have separate native and Java stacks, ignore silently for compatibility
2439     // -Xmaxjitcodesize
2440     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
2441                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
2442       julong long_ReservedCodeCacheSize = 0;
2443       ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize,
2444                                             (size_t)InitialCodeCacheSize);
2445       if (errcode != arg_in_range) {
2446         jio_fprintf(defaultStream::error_stream(),
2447                     "Invalid maximum code cache size: %s. Should be greater than InitialCodeCacheSize=%dK\n",
2448                     option->optionString, InitialCodeCacheSize/K);
2449         describe_range_error(errcode);
2450         return JNI_EINVAL;
2451       }
2452       FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize);
2453     // -green
2454     } else if (match_option(option, "-green", &tail)) {
2455       jio_fprintf(defaultStream::error_stream(),
2456                   "Green threads support not available\n");
2457           return JNI_EINVAL;
2458     // -native
2459     } else if (match_option(option, "-native", &tail)) {
2460           // HotSpot always uses native threads, ignore silently for compatibility
2461     // -Xsqnopause
2462     } else if (match_option(option, "-Xsqnopause", &tail)) {
2463           // EVM option, ignore silently for compatibility
2464     // -Xrs
2465     } else if (match_option(option, "-Xrs", &tail)) {
2466           // Classic/EVM option, new functionality
2467       FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true);
2468     } else if (match_option(option, "-Xusealtsigs", &tail)) {




2071     // use for experimentation and debugging.
2072     if (VM_Version::is_sun4v() && UseMemSetInBOT) {
2073       assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
2074       warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
2075           " on sun4v; please understand that you are using at your own risk!");
2076     }
2077   }
2078 #endif // SPARC
2079 
2080   if (PrintNMTStatistics) {
2081 #if INCLUDE_NMT
2082     if (MemTracker::tracking_level() == MemTracker::NMT_off) {
2083 #endif // INCLUDE_NMT
2084       warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2085       PrintNMTStatistics = false;
2086 #if INCLUDE_NMT
2087     }
2088 #endif
2089   }
2090 
2091   if (ReservedCodeCacheSize < InitialCodeCacheSize) {
2092           jio_fprintf(defaultStream::error_stream(),
2093             "Invalid maximum code cache size: %dK. Should be greater than InitialCodeCacheSize=%dK\n",
2094             ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
2095     status = false;
2096   }
2097 
2098   return status;
2099 }
2100 
2101 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2102   const char* option_type) {
2103   if (ignore) return false;
2104 
2105   const char* spacer = " ";
2106   if (option_type == NULL) {
2107     option_type = ++spacer; // Set both to the empty string.
2108   }
2109 
2110   if (os::obsolete_option(option)) {
2111     jio_fprintf(defaultStream::error_stream(),
2112                 "Obsolete %s%soption: %s\n", option_type, spacer,
2113       option->optionString);
2114     return false;
2115   } else {
2116     jio_fprintf(defaultStream::error_stream(),
2117                 "Unrecognized %s%soption: %s\n", option_type, spacer,


2430     // -Xss
2431     } else if (match_option(option, "-Xss", &tail)) {
2432       julong long_ThreadStackSize = 0;
2433       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2434       if (errcode != arg_in_range) {
2435         jio_fprintf(defaultStream::error_stream(),
2436                     "Invalid thread stack size: %s\n", option->optionString);
2437         describe_range_error(errcode);
2438         return JNI_EINVAL;
2439       }
2440       // Internally track ThreadStackSize in units of 1024 bytes.
2441       FLAG_SET_CMDLINE(intx, ThreadStackSize,
2442                               round_to((int)long_ThreadStackSize, K) / K);
2443     // -Xoss
2444     } else if (match_option(option, "-Xoss", &tail)) {
2445           // HotSpot does not have separate native and Java stacks, ignore silently for compatibility
2446     // -Xmaxjitcodesize
2447     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
2448                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
2449       julong long_ReservedCodeCacheSize = 0;
2450       ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1);

2451       if (errcode != arg_in_range) {
2452         jio_fprintf(defaultStream::error_stream(),
2453                     "Invalid maximum code cache size: %s. Should be greater than 1K\n", option->optionString);

2454         describe_range_error(errcode);
2455         return JNI_EINVAL;
2456       }
2457       FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize);
2458     // -green
2459     } else if (match_option(option, "-green", &tail)) {
2460       jio_fprintf(defaultStream::error_stream(),
2461                   "Green threads support not available\n");
2462           return JNI_EINVAL;
2463     // -native
2464     } else if (match_option(option, "-native", &tail)) {
2465           // HotSpot always uses native threads, ignore silently for compatibility
2466     // -Xsqnopause
2467     } else if (match_option(option, "-Xsqnopause", &tail)) {
2468           // EVM option, ignore silently for compatibility
2469     // -Xrs
2470     } else if (match_option(option, "-Xrs", &tail)) {
2471           // Classic/EVM option, new functionality
2472       FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true);
2473     } else if (match_option(option, "-Xusealtsigs", &tail)) {