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

src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp

Print this page




  73 #endif
  74 
  75   // The default CICompilerCount's value is CI_COMPILER_COUNT.
  76   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
  77   // to be true here (the option is validated later) and
  78   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
  79   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
  80 
  81   if (value < (intx)min_number_of_compiler_threads) {
  82     CommandLineError::print(verbose,
  83                             "CICompilerCount (" INTX_FORMAT ") must be "
  84                             "at least %d \n",
  85                             value, min_number_of_compiler_threads);
  86     return Flag::VIOLATES_CONSTRAINT;
  87   } else {
  88     return Flag::SUCCESS;
  89   }
  90 }
  91 
  92 Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
  93   if (value < 0) {
  94     CommandLineError::print(verbose,
  95                             "Unable to determine system-specific value for AllocatePrefetchDistance. "
  96                             "Please provide appropriate value, if unsure, use 0 to disable prefetching\n");

  97     return Flag::VIOLATES_CONSTRAINT;
  98   }
  99 
 100   return Flag::SUCCESS;
 101 }
 102 












 103 Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {
 104   intx max_value = max_intx;
 105 #if defined(SPARC)
 106   max_value = 1;
 107 #elif defined(X86)
 108   max_value = 3;
 109 #endif
 110   if (value < 0 || value > max_value) {
 111     CommandLineError::print(verbose,
 112                             "AllocatePrefetchInstr (" INTX_FORMAT ") must be "
 113                             "between 0 and " INTX_FORMAT "\n", value, max_value);
 114     return Flag::VIOLATES_CONSTRAINT;
 115   }
 116 
 117   return Flag::SUCCESS;
 118 }
 119 
 120 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
 121   intx max_value = 512;
 122   if (value < 1 || value > max_value) {
 123     CommandLineError::print(verbose,
 124                             "AllocatePrefetchStepSize (" INTX_FORMAT ") "
 125                             "must be between 1 and %d\n",
 126                             AllocatePrefetchStepSize,
 127                             max_value);
 128     return Flag::VIOLATES_CONSTRAINT;
 129   }
 130 
 131   if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) {
 132     CommandLineError::print(verbose,
 133                             "AllocatePrefetchDistance (" INTX_FORMAT ") "
 134                             "%% AllocatePrefetchStepSize (" INTX_FORMAT ") "
 135                             "= " INTX_FORMAT " "
 136                             "must be 0\n",
 137                             AllocatePrefetchDistance, AllocatePrefetchStepSize,
 138                             AllocatePrefetchDistance % AllocatePrefetchStepSize);
 139     return Flag::VIOLATES_CONSTRAINT;
 140   }
 141 
 142   /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize
 143    * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines.
 144    * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation()
 145    * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle,
 146    * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these
 147    * quantities must have the same limit (64 in this case).
 148    */
 149   if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) {
 150     CommandLineError::print(verbose,
 151                             "AllocatePrefetchDistance (" INTX_FORMAT ") too large or "
 152                             "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; "
 153                             "try decreasing/increasing values so that "
 154                             "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n",
 155                             AllocatePrefetchDistance, AllocatePrefetchStepSize,
 156                             AllocatePrefetchDistance % AllocatePrefetchStepSize);
 157     return Flag::VIOLATES_CONSTRAINT;
 158   }
 159 
 160   return Flag::SUCCESS;
 161 }
 162 
 163 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
 164   if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
 165     CommandLineError::print(verbose,
 166                             "CompileThreshold (" INTX_FORMAT ") "
 167                             "must be between 0 and %d\n",
 168                             value,
 169                             INT_MAX >> InvocationCounter::count_shift);
 170     return Flag::VIOLATES_CONSTRAINT;
 171   }
 172 
 173   return Flag::SUCCESS;
 174 }
 175 
 176 Flag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {




  73 #endif
  74 
  75   // The default CICompilerCount's value is CI_COMPILER_COUNT.
  76   // With a client VM, -XX:+TieredCompilation causes TieredCompilation
  77   // to be true here (the option is validated later) and
  78   // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
  79   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
  80 
  81   if (value < (intx)min_number_of_compiler_threads) {
  82     CommandLineError::print(verbose,
  83                             "CICompilerCount (" INTX_FORMAT ") must be "
  84                             "at least %d \n",
  85                             value, min_number_of_compiler_threads);
  86     return Flag::VIOLATES_CONSTRAINT;
  87   } else {
  88     return Flag::SUCCESS;
  89   }
  90 }
  91 
  92 Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
  93   if (value < 0 || value > 512) {
  94     CommandLineError::print(verbose,
  95                             "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
  96                             "between 0 and " INTX_FORMAT "\n",
  97                             AllocatePrefetchDistance, 512);
  98     return Flag::VIOLATES_CONSTRAINT;
  99   }
 100 
 101   return Flag::SUCCESS;
 102 }
 103 
 104 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
 105   if (AllocatePrefetchStyle == 3) {
 106     if (value % wordSize != 0) {
 107       CommandLineError::print(verbose,
 108                               "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n",
 109                               value, wordSize);
 110       return Flag::VIOLATES_CONSTRAINT;
 111     }
 112   }
 113   return Flag::SUCCESS;
 114 }
 115 
 116 Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {
 117   intx max_value = max_intx;
 118 #if defined(SPARC)
 119   max_value = 1;
 120 #elif defined(X86)
 121   max_value = 3;
 122 #endif
 123   if (value < 0 || value > max_value) {
 124     CommandLineError::print(verbose,
 125                             "AllocatePrefetchInstr (" INTX_FORMAT ") must be "
 126                             "between 0 and " INTX_FORMAT "\n", value, max_value);











































 127     return Flag::VIOLATES_CONSTRAINT;
 128   }
 129 
 130   return Flag::SUCCESS;
 131 }
 132 
 133 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
 134   if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
 135     CommandLineError::print(verbose,
 136                             "CompileThreshold (" INTX_FORMAT ") "
 137                             "must be between 0 and %d\n",
 138                             value,
 139                             INT_MAX >> InvocationCounter::count_shift);
 140     return Flag::VIOLATES_CONSTRAINT;
 141   }
 142 
 143   return Flag::SUCCESS;
 144 }
 145 
 146 Flag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {


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