src/share/vm/runtime/arguments.cpp

changeset 7315
86307d477907
parent 7279
9f35f614847d
parent 7311
327c00d0f091
child 7368
fa6adc194d48
child 7710
b1cf34d57e78
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Fri Oct 31 20:18:41 2014 -0700
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Mon Nov 03 18:18:28 2014 -0800
     1.3 @@ -300,6 +300,7 @@
     1.4    { "UseStringCache",                JDK_Version::jdk(8), JDK_Version::jdk(9) },
     1.5    { "UseOldInlining",                JDK_Version::jdk(9), JDK_Version::jdk(10) },
     1.6    { "AutoShutdownNMT",               JDK_Version::jdk(9), JDK_Version::jdk(10) },
     1.7 +  { "CompilationRepeat",             JDK_Version::jdk(8), JDK_Version::jdk(9) },
     1.8  #ifdef PRODUCT
     1.9    { "DesiredMethodLimit",
    1.10                             JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
    1.11 @@ -1144,6 +1145,32 @@
    1.12    }
    1.13  }
    1.14  
    1.15 +/**
    1.16 + * Returns the minimum number of compiler threads needed to run the JVM. The following
    1.17 + * configurations are possible.
    1.18 + *
    1.19 + * 1) The JVM is build using an interpreter only. As a result, the minimum number of
    1.20 + *    compiler threads is 0.
    1.21 + * 2) The JVM is build using the compiler(s) and tiered compilation is disabled. As
    1.22 + *    a result, either C1 or C2 is used, so the minimum number of compiler threads is 1.
    1.23 + * 3) The JVM is build using the compiler(s) and tiered compilation is enabled. However,
    1.24 + *    the option "TieredStopAtLevel < CompLevel_full_optimization". As a result, only
    1.25 + *    C1 can be used, so the minimum number of compiler threads is 1.
    1.26 + * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
    1.27 + *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
    1.28 + *    the minimum number of compiler threads is 2.
    1.29 + */
    1.30 +int Arguments::get_min_number_of_compiler_threads() {
    1.31 +#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
    1.32 +  return 0;   // case 1
    1.33 +#else
    1.34 +  if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
    1.35 +    return 1; // case 2 or case 3
    1.36 +  }
    1.37 +  return 2;   // case 4 (tiered)
    1.38 +#endif
    1.39 +}
    1.40 +
    1.41  #if INCLUDE_ALL_GCS
    1.42  static void disable_adaptive_size_policy(const char* collector_name) {
    1.43    if (UseAdaptiveSizePolicy) {
    1.44 @@ -2461,6 +2488,12 @@
    1.45    status &= verify_interval(SafepointPollOffset, 0, os::vm_page_size() - BytesPerWord, "SafepointPollOffset");
    1.46  #endif
    1.47  
    1.48 +  int min_number_of_compiler_threads = get_min_number_of_compiler_threads();
    1.49 +  // The default CICompilerCount's value is CI_COMPILER_COUNT.
    1.50 +  assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
    1.51 +  // Check the minimum number of compiler threads
    1.52 +  status &=verify_min_value(CICompilerCount, min_number_of_compiler_threads, "CICompilerCount");
    1.53 +
    1.54    return status;
    1.55  }
    1.56  
    1.57 @@ -3617,6 +3650,8 @@
    1.58    bool settings_file_specified = false;
    1.59    bool needs_hotspotrc_warning = false;
    1.60  
    1.61 +  ArgumentsExt::process_options(args);
    1.62 +
    1.63    const char* flags_file;
    1.64    int index;
    1.65    for (index = 0; index < args->nOptions; index++) {

mercurial