< prev index next >

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

Print this page




 128     return JVMFlag::VIOLATES_CONSTRAINT;
 129   }
 130 
 131   return JVMFlag::SUCCESS;
 132 }
 133 
 134 JVMFlag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
 135   if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
 136     JVMFlag::printError(verbose,
 137                         "CompileThreshold (" INTX_FORMAT ") "
 138                         "must be between 0 and %d\n",
 139                         value,
 140                         INT_MAX >> InvocationCounter::count_shift);
 141     return JVMFlag::VIOLATES_CONSTRAINT;
 142   }
 143 
 144   return JVMFlag::SUCCESS;
 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)) {
 206     JVMFlag::printError(verbose,
 207                         "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "




 128     return JVMFlag::VIOLATES_CONSTRAINT;
 129   }
 130 
 131   return JVMFlag::SUCCESS;
 132 }
 133 
 134 JVMFlag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
 135   if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
 136     JVMFlag::printError(verbose,
 137                         "CompileThreshold (" INTX_FORMAT ") "
 138                         "must be between 0 and %d\n",
 139                         value,
 140                         INT_MAX >> InvocationCounter::count_shift);
 141     return JVMFlag::VIOLATES_CONSTRAINT;
 142   }
 143 
 144   return JVMFlag::SUCCESS;
 145 }
 146 
 147 JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {
 148   int64_t  max_percentage_limit = ((int64_t)INT_MAX>>InvocationCounter::count_shift)*100;
 149   max_percentage_limit = CompileThreshold == 0  ? max_percentage_limit : max_percentage_limit/CompileThreshold;
 150   
 151   if (ProfileInterpreter) {
 152     if (value < InterpreterProfilePercentage) {
 153       JVMFlag::printError(verbose,
 154                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 155                           "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
 156                           value, InterpreterProfilePercentage);
 157       return JVMFlag::VIOLATES_CONSTRAINT;
 158     }
 159 
 160     max_percentage_limit += InterpreterProfilePercentage;
 161     if (value > max_percentage_limit) {


 162       JVMFlag::printError(verbose,
 163                           "CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage) / 100 = "
 164                           INTX_FORMAT " "
 165                           "must be between 0 and %d, try changing "
 166                           "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
 167                           (CompileThreshold * (value - InterpreterProfilePercentage)) / 100,
 168                           INT_MAX >> InvocationCounter::count_shift);
 169       return JVMFlag::VIOLATES_CONSTRAINT;
 170     }
 171   } else {
 172     if (value < 0) {
 173       JVMFlag::printError(verbose,
 174                           "OnStackReplacePercentage (" INTX_FORMAT ") must be "
 175                           "non-negative\n", value);
 176       return JVMFlag::VIOLATES_CONSTRAINT;
 177     }
 178 
 179     if (value > max_percentage_limit) {



 180       JVMFlag::printError(verbose,
 181                           "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
 182                           "must be between 0 and %d, try changing "
 183                           "CompileThreshold and/or OnStackReplacePercentage\n",
 184                           (CompileThreshold * value) / 100,
 185                           INT_MAX >> InvocationCounter::count_shift);
 186       return JVMFlag::VIOLATES_CONSTRAINT;
 187     }
 188   }
 189   return JVMFlag::SUCCESS;
 190 }
 191 
 192 JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
 193   if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
 194     JVMFlag::printError(verbose,
 195                         "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
 196                         "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
 197                         "to align entry points\n",
 198                         CodeCacheSegmentSize, CodeEntryAlignment);
 199     return JVMFlag::VIOLATES_CONSTRAINT;
 200   }
 201 
 202   if (CodeCacheSegmentSize < sizeof(jdouble)) {
 203     JVMFlag::printError(verbose,
 204                         "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "


< prev index next >