181 FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
182 }
183
184 if (UseSHA) {
185 warning("SHA instructions are not available on this CPU");
186 FLAG_SET_DEFAULT(UseSHA, false);
187 }
188 if (UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics) {
189 warning("SHA intrinsics are not available on this CPU");
190 FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
191 FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
192 FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
193 }
194
195 if (UseCRC32CIntrinsics) {
196 if (!FLAG_IS_DEFAULT(UseCRC32CIntrinsics))
197 warning("CRC32C intrinsics are not available on this CPU");
198 FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false);
199 }
200
201 // Adjust RTM (Restricted Transactional Memory) flags.
202 if (!has_tcheck() && UseRTMLocking) {
203 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
204 // setting during arguments processing. See use_biased_locking().
205 // VM_Version_init() is executed after UseBiasedLocking is used
206 // in Thread::allocate().
207 vm_exit_during_initialization("RTM instructions are not available on this CPU");
208 }
209
210 if (UseRTMLocking) {
211 #if INCLUDE_RTM_OPT
212 if (!UnlockExperimentalVMOptions) {
213 vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. "
214 "It must be enabled via -XX:+UnlockExperimentalVMOptions flag.");
215 } else {
216 warning("UseRTMLocking is only available as experimental option on this platform.");
217 }
218 if (!FLAG_IS_CMDLINE(UseRTMLocking)) {
219 // RTM locking should be used only for applications with
220 // high lock contention. For now we do not use it by default.
221 vm_exit_during_initialization("UseRTMLocking flag should be only set on command line");
222 }
223 if (!is_power_of_2(RTMTotalCountIncrRate)) {
224 warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64");
225 FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
226 }
227 if (RTMAbortRatio < 0 || RTMAbortRatio > 100) {
228 warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50");
229 FLAG_SET_DEFAULT(RTMAbortRatio, 50);
230 }
231 FLAG_SET_ERGO(bool, UseNewFastLockPPC64, false); // Does not implement TM.
232 guarantee(RTMSpinLoopCount > 0, "unsupported");
233 #else
234 // Only C2 does RTM locking optimization.
235 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
236 // setting during arguments processing. See use_biased_locking().
237 vm_exit_during_initialization("RTM locking optimization is not supported in this VM");
238 #endif
239 } else { // !UseRTMLocking
240 if (UseRTMForStackLocks) {
241 if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) {
242 warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off");
243 }
244 FLAG_SET_DEFAULT(UseRTMForStackLocks, false);
245 }
246 if (UseRTMDeopt) {
247 FLAG_SET_DEFAULT(UseRTMDeopt, false);
248 }
249 if (PrintPreciseRTMLockingStatistics) {
250 FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false);
251 }
|
181 FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
182 }
183
184 if (UseSHA) {
185 warning("SHA instructions are not available on this CPU");
186 FLAG_SET_DEFAULT(UseSHA, false);
187 }
188 if (UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics) {
189 warning("SHA intrinsics are not available on this CPU");
190 FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
191 FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
192 FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
193 }
194
195 if (UseCRC32CIntrinsics) {
196 if (!FLAG_IS_DEFAULT(UseCRC32CIntrinsics))
197 warning("CRC32C intrinsics are not available on this CPU");
198 FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false);
199 }
200
201 if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
202 UseMultiplyToLenIntrinsic = true;
203 }
204
205 // Adjust RTM (Restricted Transactional Memory) flags.
206 if (!has_tcheck() && UseRTMLocking) {
207 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
208 // setting during arguments processing. See use_biased_locking().
209 // VM_Version_init() is executed after UseBiasedLocking is used
210 // in Thread::allocate().
211 vm_exit_during_initialization("RTM instructions are not available on this CPU");
212 }
213
214 if (UseRTMLocking) {
215 #if INCLUDE_RTM_OPT
216 if (!UnlockExperimentalVMOptions) {
217 vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. "
218 "It must be enabled via -XX:+UnlockExperimentalVMOptions flag.");
219 } else {
220 warning("UseRTMLocking is only available as experimental option on this platform.");
221 }
222 if (!FLAG_IS_CMDLINE(UseRTMLocking)) {
223 // RTM locking should be used only for applications with
224 // high lock contention. For now we do not use it by default.
225 vm_exit_during_initialization("UseRTMLocking flag should be only set on command line");
226 }
227 if (!is_power_of_2(RTMTotalCountIncrRate)) {
228 warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64");
229 FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
230 }
231 if (RTMAbortRatio < 0 || RTMAbortRatio > 100) {
232 warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50");
233 FLAG_SET_DEFAULT(RTMAbortRatio, 50);
234 }
235 guarantee(RTMSpinLoopCount > 0, "unsupported");
236 #else
237 // Only C2 does RTM locking optimization.
238 // Can't continue because UseRTMLocking affects UseBiasedLocking flag
239 // setting during arguments processing. See use_biased_locking().
240 vm_exit_during_initialization("RTM locking optimization is not supported in this VM");
241 #endif
242 } else { // !UseRTMLocking
243 if (UseRTMForStackLocks) {
244 if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) {
245 warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off");
246 }
247 FLAG_SET_DEFAULT(UseRTMForStackLocks, false);
248 }
249 if (UseRTMDeopt) {
250 FLAG_SET_DEFAULT(UseRTMDeopt, false);
251 }
252 if (PrintPreciseRTMLockingStatistics) {
253 FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false);
254 }
|