< prev index next >

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp

Print this page




  77   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
  78   // to be true here (the option is validated later) and
  79   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
  80   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
  81 
  82   if (value < (intx)min_number_of_compiler_threads) {
  83     JVMFlag::printError(verbose,
  84                         "CICompilerCount (" INTX_FORMAT ") must be "
  85                         "at least %d \n",
  86                         value, min_number_of_compiler_threads);
  87     return JVMFlag::VIOLATES_CONSTRAINT;
  88   } else {
  89     return JVMFlag::SUCCESS;
  90   }
  91 }
  92 
  93 JVMFlag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
  94   if (value < 0 || value > 512) {
  95     JVMFlag::printError(verbose,
  96                         "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
  97                         "between 0 and " INTX_FORMAT "\n",
  98                         AllocatePrefetchDistance, 512);
  99     return JVMFlag::VIOLATES_CONSTRAINT;
 100   }
 101 
 102   return JVMFlag::SUCCESS;
 103 }
 104 
 105 JVMFlag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
 106   if (AllocatePrefetchStyle == 3) {
 107     if (value % wordSize != 0) {
 108       JVMFlag::printError(verbose,
 109                           "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n",
 110                           value, wordSize);
 111       return JVMFlag::VIOLATES_CONSTRAINT;
 112     }
 113   }
 114   return JVMFlag::SUCCESS;
 115 }
 116 
 117 JVMFlag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {


 145 }
 146 
 147 JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {
 148   int backward_branch_limit;
 149   if (ProfileInterpreter) {
 150     if (OnStackReplacePercentage < InterpreterProfilePercentage) {
 151       JVMFlag::printError(verbose,
 152                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 153                           "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
 154                           OnStackReplacePercentage, InterpreterProfilePercentage);
 155       return JVMFlag::VIOLATES_CONSTRAINT;
 156     }
 157 
 158     backward_branch_limit = ((CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100)
 159                             << InvocationCounter::count_shift;
 160 
 161     if (backward_branch_limit < 0) {
 162       JVMFlag::printError(verbose,
 163                           "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
 164                           INTX_FORMAT " "
 165                           "must be between 0 and " INTX_FORMAT ", try changing "
 166                           "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
 167                           (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
 168                           INT_MAX >> InvocationCounter::count_shift);
 169       return JVMFlag::VIOLATES_CONSTRAINT;
 170     }
 171   } else {
 172     if (OnStackReplacePercentage < 0 ) {
 173       JVMFlag::printError(verbose,
 174                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 175                           "non-negative\n", OnStackReplacePercentage);
 176       return JVMFlag::VIOLATES_CONSTRAINT;
 177     }
 178 
 179     backward_branch_limit = ((CompileThreshold * OnStackReplacePercentage) / 100)
 180                             << InvocationCounter::count_shift;
 181 
 182     if (backward_branch_limit < 0) {
 183       JVMFlag::printError(verbose,
 184                           "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
 185                           "must be between 0 and " INTX_FORMAT ", try changing "
 186                           "CompileThreshold and/or OnStackReplacePercentage\n",
 187                           (CompileThreshold * OnStackReplacePercentage) / 100,
 188                           INT_MAX >> InvocationCounter::count_shift);
 189       return JVMFlag::VIOLATES_CONSTRAINT;
 190     }
 191   }
 192   return JVMFlag::SUCCESS;
 193 }
 194 
 195 JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
 196   if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
 197     JVMFlag::printError(verbose,
 198                         "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
 199                         "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
 200                         "to align entry points\n",
 201                         CodeCacheSegmentSize, CodeEntryAlignment);
 202     return JVMFlag::VIOLATES_CONSTRAINT;
 203   }
 204 
 205   if (CodeCacheSegmentSize < sizeof(jdouble)) {


 378   return JVMFlag::SUCCESS;
 379 }
 380 
 381 JVMFlag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
 382   if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
 383     JVMFlag::printError(verbose,
 384                         "NodeLimitFudgeFactor must be between 2%% and 40%% "
 385                         "of MaxNodeLimit (" INTX_FORMAT ")\n",
 386                         MaxNodeLimit);
 387     return JVMFlag::VIOLATES_CONSTRAINT;
 388   }
 389 
 390   return JVMFlag::SUCCESS;
 391 }
 392 #endif // COMPILER2
 393 
 394 JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
 395 #if INCLUDE_RTM_OPT
 396   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
 397     JVMFlag::printError(verbose,
 398                         "RTMTotalCountIncrRate (" INTX_FORMAT
 399                         ") must be a power of 2, resetting it to 64\n",
 400                         RTMTotalCountIncrRate);
 401     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
 402   }
 403 #endif
 404 
 405   return JVMFlag::SUCCESS;
 406 }


  77   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
  78   // to be true here (the option is validated later) and
  79   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
  80   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
  81 
  82   if (value < (intx)min_number_of_compiler_threads) {
  83     JVMFlag::printError(verbose,
  84                         "CICompilerCount (" INTX_FORMAT ") must be "
  85                         "at least %d \n",
  86                         value, min_number_of_compiler_threads);
  87     return JVMFlag::VIOLATES_CONSTRAINT;
  88   } else {
  89     return JVMFlag::SUCCESS;
  90   }
  91 }
  92 
  93 JVMFlag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
  94   if (value < 0 || value > 512) {
  95     JVMFlag::printError(verbose,
  96                         "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
  97                         "between 0 and %d\n",
  98                         AllocatePrefetchDistance, 512);
  99     return JVMFlag::VIOLATES_CONSTRAINT;
 100   }
 101 
 102   return JVMFlag::SUCCESS;
 103 }
 104 
 105 JVMFlag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
 106   if (AllocatePrefetchStyle == 3) {
 107     if (value % wordSize != 0) {
 108       JVMFlag::printError(verbose,
 109                           "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n",
 110                           value, wordSize);
 111       return JVMFlag::VIOLATES_CONSTRAINT;
 112     }
 113   }
 114   return JVMFlag::SUCCESS;
 115 }
 116 
 117 JVMFlag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {


 145 }
 146 
 147 JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {
 148   int backward_branch_limit;
 149   if (ProfileInterpreter) {
 150     if (OnStackReplacePercentage < InterpreterProfilePercentage) {
 151       JVMFlag::printError(verbose,
 152                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 153                           "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
 154                           OnStackReplacePercentage, InterpreterProfilePercentage);
 155       return JVMFlag::VIOLATES_CONSTRAINT;
 156     }
 157 
 158     backward_branch_limit = ((CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100)
 159                             << InvocationCounter::count_shift;
 160 
 161     if (backward_branch_limit < 0) {
 162       JVMFlag::printError(verbose,
 163                           "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
 164                           INTX_FORMAT " "
 165                           "must be between 0 and %d, try changing "
 166                           "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
 167                           (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
 168                           INT_MAX >> InvocationCounter::count_shift);
 169       return JVMFlag::VIOLATES_CONSTRAINT;
 170     }
 171   } else {
 172     if (OnStackReplacePercentage < 0 ) {
 173       JVMFlag::printError(verbose,
 174                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 175                           "non-negative\n", OnStackReplacePercentage);
 176       return JVMFlag::VIOLATES_CONSTRAINT;
 177     }
 178 
 179     backward_branch_limit = ((CompileThreshold * OnStackReplacePercentage) / 100)
 180                             << InvocationCounter::count_shift;
 181 
 182     if (backward_branch_limit < 0) {
 183       JVMFlag::printError(verbose,
 184                           "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
 185                           "must be between 0 and %d, try changing "
 186                           "CompileThreshold and/or OnStackReplacePercentage\n",
 187                           (CompileThreshold * OnStackReplacePercentage) / 100,
 188                           INT_MAX >> InvocationCounter::count_shift);
 189       return JVMFlag::VIOLATES_CONSTRAINT;
 190     }
 191   }
 192   return JVMFlag::SUCCESS;
 193 }
 194 
 195 JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
 196   if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
 197     JVMFlag::printError(verbose,
 198                         "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
 199                         "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
 200                         "to align entry points\n",
 201                         CodeCacheSegmentSize, CodeEntryAlignment);
 202     return JVMFlag::VIOLATES_CONSTRAINT;
 203   }
 204 
 205   if (CodeCacheSegmentSize < sizeof(jdouble)) {


 378   return JVMFlag::SUCCESS;
 379 }
 380 
 381 JVMFlag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
 382   if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
 383     JVMFlag::printError(verbose,
 384                         "NodeLimitFudgeFactor must be between 2%% and 40%% "
 385                         "of MaxNodeLimit (" INTX_FORMAT ")\n",
 386                         MaxNodeLimit);
 387     return JVMFlag::VIOLATES_CONSTRAINT;
 388   }
 389 
 390   return JVMFlag::SUCCESS;
 391 }
 392 #endif // COMPILER2
 393 
 394 JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
 395 #if INCLUDE_RTM_OPT
 396   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
 397     JVMFlag::printError(verbose,
 398                         "RTMTotalCountIncrRate (%d) must be "
 399                         "a power of 2, resetting it to 64\n",
 400                         RTMTotalCountIncrRate);
 401     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
 402   }
 403 #endif
 404 
 405   return JVMFlag::SUCCESS;
 406 }
< prev index next >