2463 // aggressive prefetching, while still leaving the room for segregating
2464 // among the distinct pages.
2465 if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) {
2466 jio_fprintf(defaultStream::error_stream(),
2467 "ContendedPaddingWidth=" INTX_FORMAT " must be in between %d and %d\n",
2468 ContendedPaddingWidth, 0, 8192);
2469 status = false;
2470 }
2471
2472 // Need to enforce the padding not to break the existing field alignments.
2473 // It is sufficient to check against the largest type size.
2474 if ((ContendedPaddingWidth % BytesPerLong) != 0) {
2475 jio_fprintf(defaultStream::error_stream(),
2476 "ContendedPaddingWidth=" INTX_FORMAT " must be a multiple of %d\n",
2477 ContendedPaddingWidth, BytesPerLong);
2478 status = false;
2479 }
2480
2481 // Check lower bounds of the code cache
2482 // Template Interpreter code is approximately 3X larger in debug builds.
2483 uint min_code_cache_size = (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)) + CodeCacheMinimumFreeSpace;
2484 if (InitialCodeCacheSize < (uintx)os::vm_page_size()) {
2485 jio_fprintf(defaultStream::error_stream(),
2486 "Invalid InitialCodeCacheSize=%dK. Must be at least %dK.\n", InitialCodeCacheSize/K,
2487 os::vm_page_size()/K);
2488 status = false;
2489 } else if (ReservedCodeCacheSize < InitialCodeCacheSize) {
2490 jio_fprintf(defaultStream::error_stream(),
2491 "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
2492 ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
2493 status = false;
2494 } else if (ReservedCodeCacheSize < min_code_cache_size) {
2495 jio_fprintf(defaultStream::error_stream(),
2496 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
2497 min_code_cache_size/K);
2498 status = false;
2499 } else if (ReservedCodeCacheSize > 2*G) {
2500 // Code cache size larger than MAXINT is not supported.
2501 jio_fprintf(defaultStream::error_stream(),
2502 "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
2503 (2*G)/M);
2504 status = false;
2505 } else if (NonNMethodCodeHeapSize < min_code_cache_size){
2506 jio_fprintf(defaultStream::error_stream(),
2507 "Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K,
2508 min_code_cache_size/K);
2509 status = false;
2510 } else if ((!FLAG_IS_DEFAULT(NonNMethodCodeHeapSize) || !FLAG_IS_DEFAULT(ProfiledCodeHeapSize) || !FLAG_IS_DEFAULT(NonProfiledCodeHeapSize))
2511 && (NonNMethodCodeHeapSize + NonProfiledCodeHeapSize + ProfiledCodeHeapSize) != ReservedCodeCacheSize) {
2512 jio_fprintf(defaultStream::error_stream(),
2513 "Invalid code heap sizes: NonNMethodCodeHeapSize(%dK) + ProfiledCodeHeapSize(%dK) + NonProfiledCodeHeapSize(%dK) = %dK. Must be equal to ReservedCodeCacheSize = %uK.\n",
2514 NonNMethodCodeHeapSize/K, ProfiledCodeHeapSize/K, NonProfiledCodeHeapSize/K,
2515 (NonNMethodCodeHeapSize + ProfiledCodeHeapSize + NonProfiledCodeHeapSize)/K, ReservedCodeCacheSize/K);
2516 status = false;
2517 }
2518
2519 status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction");
2520 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");
2521 status &= verify_interval(CodeCacheMinBlockLength, 1, 100, "CodeCacheMinBlockLength");
2522 status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
2523
2524 int min_number_of_compiler_threads = get_min_number_of_compiler_threads();
2525 // The default CICompilerCount's value is CI_COMPILER_COUNT.
2526 assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
2527 // Check the minimum number of compiler threads
2528 status &=verify_min_value(CICompilerCount, min_number_of_compiler_threads, "CICompilerCount");
2529
2530 if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
2531 warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
2532 }
2533
2534 return status;
2535 }
2536
2537 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2538 const char* option_type) {
2539 if (ignore) return false;
3898
3899 // Set flags based on ergonomics.
3900 set_ergonomics_flags();
3901
3902 set_shared_spaces_flags();
3903
3904 // Check the GC selections again.
3905 if (!ArgumentsExt::check_gc_consistency_ergo()) {
3906 return JNI_EINVAL;
3907 }
3908
3909 if (TieredCompilation) {
3910 set_tiered_flags();
3911 } else {
3912 // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
3913 if (CompilationPolicyChoice >= 2) {
3914 vm_exit_during_initialization(
3915 "Incompatible compilation policy selected", NULL);
3916 }
3917 }
3918 // Set NmethodSweepFraction after the size of the code cache is adapted (in case of tiered)
3919 if (FLAG_IS_DEFAULT(NmethodSweepFraction)) {
3920 FLAG_SET_DEFAULT(NmethodSweepFraction, 1 + ReservedCodeCacheSize / (16 * M));
3921 }
3922
3923
3924 // Set heap size based on available physical memory
3925 set_heap_size();
3926
3927 set_gc_specific_flags();
3928
3929 // Initialize Metaspace flags and alignments
3930 Metaspace::ergo_initialize();
3931
3932 // Set bytecode rewriting flags
3933 set_bytecode_flags();
3934
3935 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled
3936 set_aggressive_opts_flags();
3937
3938 // Turn off biased locking for locking debug mode flags,
3939 // which are subtly different from each other but neither works with
3940 // biased locking
3941 if (UseHeavyMonitors
3942 #ifdef COMPILER1
3971 if (!IncrementalInline) {
3972 AlwaysIncrementalInline = false;
3973 }
3974 #endif
3975 if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) {
3976 // nothing to use the profiling, turn if off
3977 FLAG_SET_DEFAULT(TypeProfileLevel, 0);
3978 }
3979 #endif
3980
3981 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
3982 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
3983 DebugNonSafepoints = true;
3984 }
3985
3986 if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
3987 warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
3988 }
3989
3990 #ifndef PRODUCT
3991 if (CompileTheWorld) {
3992 // Force NmethodSweeper to sweep whole CodeCache each time.
3993 if (FLAG_IS_DEFAULT(NmethodSweepFraction)) {
3994 NmethodSweepFraction = 1;
3995 }
3996 }
3997
3998 if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
3999 if (use_vm_log()) {
4000 LogVMOutput = true;
4001 }
4002 }
4003 #endif // PRODUCT
4004
4005 if (PrintCommandLineFlags) {
4006 CommandLineFlags::printSetFlags(tty);
4007 }
4008
4009 // Apply CPU specific policy for the BiasedLocking
4010 if (UseBiasedLocking) {
4011 if (!VM_Version::use_biased_locking() &&
4012 !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4013 UseBiasedLocking = false;
4014 }
4015 }
4016 #ifdef COMPILER2
4017 if (!UseBiasedLocking || EmitSync != 0) {
|
2463 // aggressive prefetching, while still leaving the room for segregating
2464 // among the distinct pages.
2465 if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) {
2466 jio_fprintf(defaultStream::error_stream(),
2467 "ContendedPaddingWidth=" INTX_FORMAT " must be in between %d and %d\n",
2468 ContendedPaddingWidth, 0, 8192);
2469 status = false;
2470 }
2471
2472 // Need to enforce the padding not to break the existing field alignments.
2473 // It is sufficient to check against the largest type size.
2474 if ((ContendedPaddingWidth % BytesPerLong) != 0) {
2475 jio_fprintf(defaultStream::error_stream(),
2476 "ContendedPaddingWidth=" INTX_FORMAT " must be a multiple of %d\n",
2477 ContendedPaddingWidth, BytesPerLong);
2478 status = false;
2479 }
2480
2481 // Check lower bounds of the code cache
2482 // Template Interpreter code is approximately 3X larger in debug builds.
2483 uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3);
2484 if (InitialCodeCacheSize < (uintx)os::vm_page_size()) {
2485 jio_fprintf(defaultStream::error_stream(),
2486 "Invalid InitialCodeCacheSize=%dK. Must be at least %dK.\n", InitialCodeCacheSize/K,
2487 os::vm_page_size()/K);
2488 status = false;
2489 } else if (ReservedCodeCacheSize < InitialCodeCacheSize) {
2490 jio_fprintf(defaultStream::error_stream(),
2491 "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
2492 ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
2493 status = false;
2494 } else if (ReservedCodeCacheSize < min_code_cache_size) {
2495 jio_fprintf(defaultStream::error_stream(),
2496 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
2497 min_code_cache_size/K);
2498 status = false;
2499 } else if (ReservedCodeCacheSize > 2*G) {
2500 // Code cache size larger than MAXINT is not supported.
2501 jio_fprintf(defaultStream::error_stream(),
2502 "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
2503 (2*G)/M);
2504 status = false;
2505 } else if (NonNMethodCodeHeapSize < min_code_cache_size){
2506 jio_fprintf(defaultStream::error_stream(),
2507 "Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K,
2508 min_code_cache_size/K);
2509 status = false;
2510 } else if ((!FLAG_IS_DEFAULT(NonNMethodCodeHeapSize) || !FLAG_IS_DEFAULT(ProfiledCodeHeapSize) || !FLAG_IS_DEFAULT(NonProfiledCodeHeapSize))
2511 && (NonNMethodCodeHeapSize + NonProfiledCodeHeapSize + ProfiledCodeHeapSize) != ReservedCodeCacheSize) {
2512 jio_fprintf(defaultStream::error_stream(),
2513 "Invalid code heap sizes: NonNMethodCodeHeapSize(%dK) + ProfiledCodeHeapSize(%dK) + NonProfiledCodeHeapSize(%dK) = %dK. Must be equal to ReservedCodeCacheSize = %uK.\n",
2514 NonNMethodCodeHeapSize/K, ProfiledCodeHeapSize/K, NonProfiledCodeHeapSize/K,
2515 (NonNMethodCodeHeapSize + ProfiledCodeHeapSize + NonProfiledCodeHeapSize)/K, ReservedCodeCacheSize/K);
2516 status = false;
2517 }
2518
2519 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");
2520 status &= verify_interval(CodeCacheMinBlockLength, 1, 100, "CodeCacheMinBlockLength");
2521 status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
2522
2523 int min_number_of_compiler_threads = get_min_number_of_compiler_threads();
2524 // The default CICompilerCount's value is CI_COMPILER_COUNT.
2525 assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
2526 // Check the minimum number of compiler threads
2527 status &=verify_min_value(CICompilerCount, min_number_of_compiler_threads, "CICompilerCount");
2528
2529 if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
2530 warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
2531 }
2532
2533 return status;
2534 }
2535
2536 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2537 const char* option_type) {
2538 if (ignore) return false;
3897
3898 // Set flags based on ergonomics.
3899 set_ergonomics_flags();
3900
3901 set_shared_spaces_flags();
3902
3903 // Check the GC selections again.
3904 if (!ArgumentsExt::check_gc_consistency_ergo()) {
3905 return JNI_EINVAL;
3906 }
3907
3908 if (TieredCompilation) {
3909 set_tiered_flags();
3910 } else {
3911 // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
3912 if (CompilationPolicyChoice >= 2) {
3913 vm_exit_during_initialization(
3914 "Incompatible compilation policy selected", NULL);
3915 }
3916 }
3917
3918 // Set heap size based on available physical memory
3919 set_heap_size();
3920
3921 set_gc_specific_flags();
3922
3923 // Initialize Metaspace flags and alignments
3924 Metaspace::ergo_initialize();
3925
3926 // Set bytecode rewriting flags
3927 set_bytecode_flags();
3928
3929 // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled
3930 set_aggressive_opts_flags();
3931
3932 // Turn off biased locking for locking debug mode flags,
3933 // which are subtly different from each other but neither works with
3934 // biased locking
3935 if (UseHeavyMonitors
3936 #ifdef COMPILER1
3965 if (!IncrementalInline) {
3966 AlwaysIncrementalInline = false;
3967 }
3968 #endif
3969 if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) {
3970 // nothing to use the profiling, turn if off
3971 FLAG_SET_DEFAULT(TypeProfileLevel, 0);
3972 }
3973 #endif
3974
3975 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
3976 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
3977 DebugNonSafepoints = true;
3978 }
3979
3980 if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
3981 warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
3982 }
3983
3984 #ifndef PRODUCT
3985 if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
3986 if (use_vm_log()) {
3987 LogVMOutput = true;
3988 }
3989 }
3990 #endif // PRODUCT
3991
3992 if (PrintCommandLineFlags) {
3993 CommandLineFlags::printSetFlags(tty);
3994 }
3995
3996 // Apply CPU specific policy for the BiasedLocking
3997 if (UseBiasedLocking) {
3998 if (!VM_Version::use_biased_locking() &&
3999 !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
4000 UseBiasedLocking = false;
4001 }
4002 }
4003 #ifdef COMPILER2
4004 if (!UseBiasedLocking || EmitSync != 0) {
|