src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/arguments.cpp	Fri Aug 29 15:59:15 2014
--- new/src/share/vm/runtime/arguments.cpp	Fri Aug 29 15:59:15 2014

*** 1143,1152 **** --- 1143,1163 ---- } // Increase the code cache size - tiered compiles a lot more. if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5); } + // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M + if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) { + FLAG_SET_ERGO(bool, SegmentedCodeCache, true); + + // Multiply sizes by 5 but fix non_method_size (distribute among non-profiled and profiled code heap) + intx non_method_size = ReservedCodeCacheSize - (ProfiledCodeHeapSize + NonProfiledCodeHeapSize); + if (FLAG_IS_DEFAULT(NonProfiledCodeHeapSize) && FLAG_IS_DEFAULT(ProfiledCodeHeapSize)) { + FLAG_SET_DEFAULT(ProfiledCodeHeapSize, ProfiledCodeHeapSize * 5 + non_method_size * 2); + FLAG_SET_DEFAULT(NonProfiledCodeHeapSize, NonProfiledCodeHeapSize * 5 + non_method_size * 2); + } + } if (!UseInterpreter) { // -Xcomp Tier3InvokeNotifyFreqLog = 0; Tier4InvocationThreshold = 0; } }
*** 2440,2449 **** --- 2451,2471 ---- // Code cache size larger than MAXINT is not supported. jio_fprintf(defaultStream::error_stream(), "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M, (2*G)/M); status = false; + } else if (NonMethodCodeHeapSize < min_code_cache_size){ + jio_fprintf(defaultStream::error_stream(), + "Invalid NonMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonMethodCodeHeapSize/K, + min_code_cache_size/K); + status = false; + } else if ((!FLAG_IS_DEFAULT(NonMethodCodeHeapSize) || !FLAG_IS_DEFAULT(ProfiledCodeHeapSize) || !FLAG_IS_DEFAULT(NonProfiledCodeHeapSize)) + && (NonMethodCodeHeapSize + NonProfiledCodeHeapSize + ProfiledCodeHeapSize) != ReservedCodeCacheSize) { + jio_fprintf(defaultStream::error_stream(), + "Invalid NonMethodCodeHeapSize + ProfiledCodeHeapSize + NonProfiledCodeHeapSize = %dK. Must be equal to ReservedCodeCacheSize = %uK.\n", + (NonMethodCodeHeapSize + ProfiledCodeHeapSize + NonProfiledCodeHeapSize)/K, ReservedCodeCacheSize/K); + status = false; } status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); status &= verify_interval(CodeCacheMinBlockLength, 1, 100, "CodeCacheMinBlockLength");
*** 2866,2875 **** --- 2888,2930 ---- jio_fprintf(defaultStream::error_stream(), "Invalid maximum code cache size: %s.\n", option->optionString); return JNI_EINVAL; } FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize); + // -XX:NonMethodCodeHeapSize= + } else if (match_option(option, "-XX:NonMethodCodeHeapSize=", &tail)) { + julong long_NonMethodCodeHeapSize = 0; + + ArgsRange errcode = parse_memory_size(tail, &long_NonMethodCodeHeapSize, 1); + if (errcode != arg_in_range) { + jio_fprintf(defaultStream::error_stream(), + "Invalid maximum non-method code heap size: %s.\n", option->optionString); + return JNI_EINVAL; + } + FLAG_SET_CMDLINE(uintx, NonMethodCodeHeapSize, (uintx)long_NonMethodCodeHeapSize); + // -XX:ProfiledCodeHeapSize= + } else if (match_option(option, "-XX:ProfiledCodeHeapSize=", &tail)) { + julong long_ProfiledCodeHeapSize = 0; + + ArgsRange errcode = parse_memory_size(tail, &long_ProfiledCodeHeapSize, 1); + if (errcode != arg_in_range) { + jio_fprintf(defaultStream::error_stream(), + "Invalid maximum profiled code heap size: %s.\n", option->optionString); + return JNI_EINVAL; + } + FLAG_SET_CMDLINE(uintx, ProfiledCodeHeapSize, (uintx)long_ProfiledCodeHeapSize); + // -XX:NonProfiledCodeHeapSizee= + } else if (match_option(option, "-XX:NonProfiledCodeHeapSize=", &tail)) { + julong long_NonProfiledCodeHeapSize = 0; + + ArgsRange errcode = parse_memory_size(tail, &long_NonProfiledCodeHeapSize, 1); + if (errcode != arg_in_range) { + jio_fprintf(defaultStream::error_stream(), + "Invalid maximum non-profiled code heap size: %s.\n", option->optionString); + return JNI_EINVAL; + } + FLAG_SET_CMDLINE(uintx, NonProfiledCodeHeapSize, (uintx)long_NonProfiledCodeHeapSize); //-XX:IncreaseFirstTierCompileThresholdAt= } else if (match_option(option, "-XX:IncreaseFirstTierCompileThresholdAt=", &tail)) { uintx uint_IncreaseFirstTierCompileThresholdAt = 0; if (!parse_uintx(tail, &uint_IncreaseFirstTierCompileThresholdAt, 0) || uint_IncreaseFirstTierCompileThresholdAt > 99) { jio_fprintf(defaultStream::error_stream(),

src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File