1.1 --- a/src/share/vm/runtime/arguments.cpp Wed May 28 08:09:26 2014 -0400 1.2 +++ b/src/share/vm/runtime/arguments.cpp Thu May 29 13:14:25 2014 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -50,6 +50,9 @@ 1.11 #ifdef TARGET_OS_FAMILY_windows 1.12 # include "os_windows.inline.hpp" 1.13 #endif 1.14 +#ifdef TARGET_OS_FAMILY_aix 1.15 +# include "os_aix.inline.hpp" 1.16 +#endif 1.17 #ifdef TARGET_OS_FAMILY_bsd 1.18 # include "os_bsd.inline.hpp" 1.19 #endif 1.20 @@ -290,6 +293,7 @@ 1.21 { "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 1.22 { "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 1.23 { "UseStringCache", JDK_Version::jdk(8), JDK_Version::jdk(9) }, 1.24 + { "UseOldInlining", JDK_Version::jdk(9), JDK_Version::jdk(10) }, 1.25 #ifdef PRODUCT 1.26 { "DesiredMethodLimit", 1.27 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, 1.28 @@ -836,7 +840,7 @@ 1.29 for (int i=0; i < _num_jvm_flags; i++) { 1.30 st->print("%s ", _jvm_flags_array[i]); 1.31 } 1.32 - st->print_cr(""); 1.33 + st->cr(); 1.34 } 1.35 } 1.36 1.37 @@ -845,7 +849,7 @@ 1.38 for (int i=0; i < _num_jvm_args; i++) { 1.39 st->print("%s ", _jvm_args_array[i]); 1.40 } 1.41 - st->print_cr(""); 1.42 + st->cr(); 1.43 } 1.44 } 1.45 1.46 @@ -878,7 +882,7 @@ 1.47 arg_len = equal_sign - argname; 1.48 } 1.49 1.50 - Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true); 1.51 + Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true); 1.52 if (found_flag != NULL) { 1.53 char locked_message_buf[BUFLEN]; 1.54 found_flag->get_locked_message(locked_message_buf, BUFLEN); 1.55 @@ -1337,8 +1341,8 @@ 1.56 } 1.57 if (PrintGCDetails && Verbose) { 1.58 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1.59 - MarkStackSize / K, MarkStackSizeMax / K); 1.60 - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1.61 + (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); 1.62 + tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads); 1.63 } 1.64 } 1.65 #endif // INCLUDE_ALL_GCS 1.66 @@ -1418,7 +1422,7 @@ 1.67 if (PrintGCDetails) { 1.68 // Cannot use gclog_or_tty yet. 1.69 tty->print_cr("Automatic selection of the low pause collector" 1.70 - " based on pause goal of %d (ms)", MaxGCPauseMillis); 1.71 + " based on pause goal of %d (ms)", (int) MaxGCPauseMillis); 1.72 } 1.73 return true; 1.74 } 1.75 @@ -1569,6 +1573,16 @@ 1.76 vm_exit(1); 1.77 } 1.78 1.79 + if (UseAdaptiveSizePolicy) { 1.80 + // We don't want to limit adaptive heap sizing's freedom to adjust the heap 1.81 + // unless the user actually sets these flags. 1.82 + if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) { 1.83 + FLAG_SET_DEFAULT(MinHeapFreeRatio, 0); 1.84 + } 1.85 + if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) { 1.86 + FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100); 1.87 + } 1.88 + } 1.89 1.90 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the 1.91 // SurvivorRatio has been set, reset their default values to SurvivorRatio + 1.92 @@ -1625,8 +1639,8 @@ 1.93 1.94 if (PrintGCDetails && Verbose) { 1.95 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1.96 - MarkStackSize / K, MarkStackSizeMax / K); 1.97 - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1.98 + (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); 1.99 + tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads); 1.100 } 1.101 } 1.102 1.103 @@ -1689,7 +1703,7 @@ 1.104 1.105 if (PrintGCDetails && Verbose) { 1.106 // Cannot use gclog_or_tty yet. 1.107 - tty->print_cr(" Maximum heap size " SIZE_FORMAT, reasonable_max); 1.108 + tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); 1.109 } 1.110 FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max); 1.111 } 1.112 @@ -1844,7 +1858,7 @@ 1.113 } 1.114 1.115 bool Arguments::verify_percentage(uintx value, const char* name) { 1.116 - if (value <= 100) { 1.117 + if (is_percentage(value)) { 1.118 return true; 1.119 } 1.120 jio_fprintf(defaultStream::error_stream(), 1.121 @@ -1866,24 +1880,22 @@ 1.122 // check if do gclog rotation 1.123 // +UseGCLogFileRotation is a must, 1.124 // no gc log rotation when log file not supplied or 1.125 -// NumberOfGCLogFiles is 0, or GCLogFileSize is 0 1.126 +// NumberOfGCLogFiles is 0 1.127 void check_gclog_consistency() { 1.128 if (UseGCLogFileRotation) { 1.129 - if ((Arguments::gc_log_filename() == NULL) || 1.130 - (NumberOfGCLogFiles == 0) || 1.131 - (GCLogFileSize == 0)) { 1.132 + if ((Arguments::gc_log_filename() == NULL) || (NumberOfGCLogFiles == 0)) { 1.133 jio_fprintf(defaultStream::output_stream(), 1.134 - "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>[k|K|m|M|g|G]\n" 1.135 - "where num_of_file > 0 and num_of_size > 0\n" 1.136 + "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files>\n" 1.137 + "where num_of_file > 0\n" 1.138 "GC log rotation is turned off\n"); 1.139 UseGCLogFileRotation = false; 1.140 } 1.141 } 1.142 1.143 - if (UseGCLogFileRotation && GCLogFileSize < 8*K) { 1.144 - FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K); 1.145 - jio_fprintf(defaultStream::output_stream(), 1.146 - "GCLogFileSize changed to minimum 8K\n"); 1.147 + if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) { 1.148 + FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K); 1.149 + jio_fprintf(defaultStream::output_stream(), 1.150 + "GCLogFileSize changed to minimum 8K\n"); 1.151 } 1.152 } 1.153 1.154 @@ -1932,6 +1944,34 @@ 1.155 return count_p < 2 && count_t < 2; 1.156 } 1.157 1.158 +bool Arguments::verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_heap_free_ratio) { 1.159 + if (!is_percentage(min_heap_free_ratio)) { 1.160 + err_msg.print("MinHeapFreeRatio must have a value between 0 and 100"); 1.161 + return false; 1.162 + } 1.163 + if (min_heap_free_ratio > MaxHeapFreeRatio) { 1.164 + err_msg.print("MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " 1.165 + "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")", min_heap_free_ratio, 1.166 + MaxHeapFreeRatio); 1.167 + return false; 1.168 + } 1.169 + return true; 1.170 +} 1.171 + 1.172 +bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio) { 1.173 + if (!is_percentage(max_heap_free_ratio)) { 1.174 + err_msg.print("MaxHeapFreeRatio must have a value between 0 and 100"); 1.175 + return false; 1.176 + } 1.177 + if (max_heap_free_ratio < MinHeapFreeRatio) { 1.178 + err_msg.print("MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or " 1.179 + "equal to MinHeapFreeRatio (" UINTX_FORMAT ")", max_heap_free_ratio, 1.180 + MinHeapFreeRatio); 1.181 + return false; 1.182 + } 1.183 + return true; 1.184 +} 1.185 + 1.186 // Check consistency of GC selection 1.187 bool Arguments::check_gc_consistency() { 1.188 check_gclog_consistency(); 1.189 @@ -2037,8 +2077,6 @@ 1.190 status = status && verify_interval(AdaptiveSizePolicyWeight, 0, 100, 1.191 "AdaptiveSizePolicyWeight"); 1.192 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance"); 1.193 - status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio"); 1.194 - status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio"); 1.195 1.196 // Divide by bucket size to prevent a large size from causing rollover when 1.197 // calculating amount of memory needed to be allocated for the String table. 1.198 @@ -2048,15 +2086,19 @@ 1.199 status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize, 1.200 (max_uintx / SymbolTable::bucket_size()), "SymbolTable size"); 1.201 1.202 - if (MinHeapFreeRatio > MaxHeapFreeRatio) { 1.203 - jio_fprintf(defaultStream::error_stream(), 1.204 - "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " 1.205 - "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", 1.206 - MinHeapFreeRatio, MaxHeapFreeRatio); 1.207 - status = false; 1.208 + { 1.209 + // Using "else if" below to avoid printing two error messages if min > max. 1.210 + // This will also prevent us from reporting both min>100 and max>100 at the 1.211 + // same time, but that is less annoying than printing two identical errors IMHO. 1.212 + FormatBuffer<80> err_msg("%s",""); 1.213 + if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) { 1.214 + jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer()); 1.215 + status = false; 1.216 + } else if (!verify_MaxHeapFreeRatio(err_msg, MaxHeapFreeRatio)) { 1.217 + jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer()); 1.218 + status = false; 1.219 + } 1.220 } 1.221 - // Keeping the heap 100% free is hard ;-) so limit it to 99%. 1.222 - MinHeapFreeRatio = MIN2(MinHeapFreeRatio, (uintx) 99); 1.223 1.224 // Min/MaxMetaspaceFreeRatio 1.225 status = status && verify_percentage(MinMetaspaceFreeRatio, "MinMetaspaceFreeRatio"); 1.226 @@ -2176,6 +2218,8 @@ 1.227 "G1ConcRSHotCardLimit"); 1.228 status = status && verify_interval(G1ConcRSLogCacheSize, 0, 31, 1.229 "G1ConcRSLogCacheSize"); 1.230 + status = status && verify_interval(StringDeduplicationAgeThreshold, 1, markOopDesc::max_age, 1.231 + "StringDeduplicationAgeThreshold"); 1.232 } 1.233 if (UseConcMarkSweepGC) { 1.234 status = status && verify_min_value(CMSOldPLABNumRefills, 1, "CMSOldPLABNumRefills"); 1.235 @@ -2339,6 +2383,10 @@ 1.236 status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); 1.237 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); 1.238 1.239 + if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) { 1.240 + warning("The VM option CICompilerCountPerCPU overrides CICompilerCount."); 1.241 + } 1.242 + 1.243 #ifdef COMPILER1 1.244 status &= verify_interval(SafepointPollOffset, 0, os::vm_page_size() - BytesPerWord, "SafepointPollOffset"); 1.245 #endif 1.246 @@ -2693,7 +2741,7 @@ 1.247 } else if (match_option(option, "-Xmaxf", &tail)) { 1.248 char* err; 1.249 int maxf = (int)(strtod(tail, &err) * 100); 1.250 - if (*err != '\0' || maxf < 0 || maxf > 100) { 1.251 + if (*err != '\0' || *tail == '\0' || maxf < 0 || maxf > 100) { 1.252 jio_fprintf(defaultStream::error_stream(), 1.253 "Bad max heap free percentage size: %s\n", 1.254 option->optionString); 1.255 @@ -2705,7 +2753,7 @@ 1.256 } else if (match_option(option, "-Xminf", &tail)) { 1.257 char* err; 1.258 int minf = (int)(strtod(tail, &err) * 100); 1.259 - if (*err != '\0' || minf < 0 || minf > 100) { 1.260 + if (*err != '\0' || *tail == '\0' || minf < 0 || minf > 100) { 1.261 jio_fprintf(defaultStream::error_stream(), 1.262 "Bad min heap free percentage size: %s\n", 1.263 option->optionString); 1.264 @@ -3650,9 +3698,9 @@ 1.265 // Set per-collector flags 1.266 if (UseParallelGC || UseParallelOldGC) { 1.267 set_parallel_gc_flags(); 1.268 - } else if (UseConcMarkSweepGC) { // should be done before ParNew check below 1.269 + } else if (UseConcMarkSweepGC) { // Should be done before ParNew check below 1.270 set_cms_and_parnew_gc_flags(); 1.271 - } else if (UseParNewGC) { // skipped if CMS is set above 1.272 + } else if (UseParNewGC) { // Skipped if CMS is set above 1.273 set_parnew_gc_flags(); 1.274 } else if (UseG1GC) { 1.275 set_g1_gc_flags(); 1.276 @@ -3666,6 +3714,10 @@ 1.277 " using -XX:ParallelGCThreads=N"); 1.278 } 1.279 } 1.280 + if (MinHeapFreeRatio == 100) { 1.281 + // Keeping the heap 100% free is hard ;-) so limit it to 99%. 1.282 + FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99); 1.283 + } 1.284 #else // INCLUDE_ALL_GCS 1.285 assert(verify_serial_gc_flags(), "SerialGC unset"); 1.286 #endif // INCLUDE_ALL_GCS 1.287 @@ -3696,8 +3748,8 @@ 1.288 UseBiasedLocking = false; 1.289 } 1.290 1.291 -#ifdef CC_INTERP 1.292 - // Clear flags not supported by the C++ interpreter 1.293 +#ifdef ZERO 1.294 + // Clear flags not supported on zero. 1.295 FLAG_SET_DEFAULT(ProfileInterpreter, false); 1.296 FLAG_SET_DEFAULT(UseBiasedLocking, false); 1.297 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false)); 1.298 @@ -3705,9 +3757,6 @@ 1.299 #endif // CC_INTERP 1.300 1.301 #ifdef COMPILER2 1.302 - if (!UseBiasedLocking || EmitSync != 0) { 1.303 - UseOptoBiasInlining = false; 1.304 - } 1.305 if (!EliminateLocks) { 1.306 EliminateNestedLocks = false; 1.307 } 1.308 @@ -3731,10 +3780,6 @@ 1.309 // Doing the replace in parent maps helps speculation 1.310 FLAG_SET_DEFAULT(ReplaceInParentMaps, true); 1.311 } 1.312 -#ifndef X86 1.313 - // Only on x86 for now 1.314 - FLAG_SET_DEFAULT(TypeProfileLevel, 0); 1.315 -#endif 1.316 #endif 1.317 1.318 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) { 1.319 @@ -3772,6 +3817,11 @@ 1.320 UseBiasedLocking = false; 1.321 } 1.322 } 1.323 +#ifdef COMPILER2 1.324 + if (!UseBiasedLocking || EmitSync != 0) { 1.325 + UseOptoBiasInlining = false; 1.326 + } 1.327 +#endif 1.328 1.329 // set PauseAtExit if the gamma launcher was used and a debugger is attached 1.330 // but only if not already set on the commandline