hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp
changeset 32351 1da9b960b3d4
parent 32087 dcbcf15229a9
child 33160 c59f1676d27e
equal deleted inserted replaced
32349:8b5eb3750c41 32351:1da9b960b3d4
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "runtime/arguments.hpp"
    26 #include "runtime/arguments.hpp"
    27 #include "runtime/commandLineFlagConstraintsCompiler.hpp"
    27 #include "runtime/commandLineFlagConstraintsCompiler.hpp"
       
    28 #include "runtime/commandLineFlagRangeList.hpp"
    28 #include "runtime/globals.hpp"
    29 #include "runtime/globals.hpp"
    29 #include "utilities/defaultStream.hpp"
    30 #include "utilities/defaultStream.hpp"
    30 
    31 
    31 Flag::Error AliasLevelConstraintFunc(bool verbose, intx* value) {
    32 Flag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
    32   if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) {
    33   if ((value <= 1) && (Arguments::mode() == Arguments::_comp)) {
    33     if (verbose == true) {
    34     CommandLineError::print(verbose,
    34       jio_fprintf(defaultStream::error_stream(),
    35                             "AliasLevel (" INTX_FORMAT ") is not "
    35                 "AliasLevel (" INTX_FORMAT ") is not compatible "
    36                             "compatible with -Xcomp \n",
    36                 "with -Xcomp \n",
    37                             value);
    37                 *value);
       
    38     }
       
    39     return Flag::VIOLATES_CONSTRAINT;
    38     return Flag::VIOLATES_CONSTRAINT;
    40   } else {
    39   } else {
    41     return Flag::SUCCESS;
    40     return Flag::SUCCESS;
    42   }
    41   }
    43 }
    42 }
    55  *    C1 can be used, so the minimum number of compiler threads is 1.
    54  *    C1 can be used, so the minimum number of compiler threads is 1.
    56  * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
    55  * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
    57  *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
    56  *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
    58  *    the minimum number of compiler threads is 2.
    57  *    the minimum number of compiler threads is 2.
    59  */
    58  */
    60 Flag::Error CICompilerCountConstraintFunc(bool verbose, intx* value) {
    59 Flag::Error CICompilerCountConstraintFunc(intx value, bool verbose) {
    61   int min_number_of_compiler_threads = 0;
    60   int min_number_of_compiler_threads = 0;
    62 #if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
    61 #if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)
    63   // case 1
    62   // case 1
    64 #else
    63 #else
    65   if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
    64   if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
    73   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
    72   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
    74   // to be true here (the option is validated later) and
    73   // to be true here (the option is validated later) and
    75   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
    74   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
    76   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
    75   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
    77 
    76 
    78   if (*value < (intx)min_number_of_compiler_threads) {
    77   if (value < (intx)min_number_of_compiler_threads) {
    79     if (verbose == true) {
    78     CommandLineError::print(verbose,
    80       jio_fprintf(defaultStream::error_stream(),
    79                             "CICompilerCount (" INTX_FORMAT ") must be "
    81                   "CICompilerCount=" INTX_FORMAT " must be at least %d \n",
    80                             "at least %d \n",
    82                   *value, min_number_of_compiler_threads);
    81                             value, min_number_of_compiler_threads);
    83     }
       
    84     return Flag::VIOLATES_CONSTRAINT;
    82     return Flag::VIOLATES_CONSTRAINT;
    85   } else {
    83   } else {
    86     return Flag::SUCCESS;
    84     return Flag::SUCCESS;
    87   }
    85   }
    88 }
    86 }