72 } 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) { | 72 } 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 AllocatePrefetchStyleConstraintFunc(intx value, bool verbose) { 93 intx max_value; 94 #if defined(SPARC) 95 max_value = 3; 96 #else 97 max_value = 2; 98 #endif 99 if (value < 0 || value > max_value) { 100 CommandLineError::print(verbose, 101 "AllocatePrefetchStyle (" INTX_FORMAT ") must be " 102 "between 0 and " INTX_FORMAT "\n", value, max_value); 103 return Flag::VIOLATES_CONSTRAINT; 104 } 105 106 return Flag::SUCCESS; 107 } 108 109 Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) { 110 intx min_value; 111 if (AllocatePrefetchStyle == 3) { 112 min_value = wordSize; 113 } else { 114 min_value = 0; 115 } 116 117 if (value < min_value || value > 512) { 118 CommandLineError::print(verbose, 119 "AllocatePrefetchDistance (" INTX_FORMAT ") must be " 120 "between " INTX_FORMAT " and " INTX_FORMAT "\n", 121 AllocatePrefetchDistance, min_value, 512); 122 return Flag::VIOLATES_CONSTRAINT; 123 } 124 125 return Flag::SUCCESS; 126 } 127 128 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { 129 if (AllocatePrefetchStyle == 3) { 130 if (value % wordSize != 0) { 131 CommandLineError::print(verbose, 132 "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n", 133 value, wordSize); 134 return Flag::VIOLATES_CONSTRAINT; 135 } 136 } 137 return Flag::SUCCESS; 138 } 139 140 Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) { 141 intx max_value = max_intx; 142 #if defined(SPARC) 143 max_value = 1; 144 #elif defined(X86) 145 max_value = 3; 146 #endif 147 if (value < 0 || value > max_value) { 148 CommandLineError::print(verbose, 149 "AllocatePrefetchInstr (" INTX_FORMAT ") must be " 150 "between 0 and " INTX_FORMAT "\n", value, max_value); 151 return Flag::VIOLATES_CONSTRAINT; 152 } 153 154 return Flag::SUCCESS; 155 } 156 157 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { 158 if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) { 159 CommandLineError::print(verbose, 160 "CompileThreshold (" INTX_FORMAT ") " 161 "must be between 0 and %d\n", 162 value, 163 INT_MAX >> InvocationCounter::count_shift); 164 return Flag::VIOLATES_CONSTRAINT; 165 } 166 167 return Flag::SUCCESS; 168 } 169 170 Flag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) { |