1763 return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
1764 }
1765
1766 bool Arguments::sun_java_launcher_is_altjvm() {
1767 return _sun_java_launcher_is_altjvm;
1768 }
1769
1770 //===========================================================================================================
1771 // Parsing of main arguments
1772
1773 static unsigned int addreads_count = 0;
1774 static unsigned int addexports_count = 0;
1775 static unsigned int addopens_count = 0;
1776 static unsigned int patch_mod_count = 0;
1777 static unsigned int enable_native_access_count = 0;
1778 static bool patch_mod_javabase = false;
1779
1780 // Check the consistency of vm_init_args
1781 bool Arguments::check_vm_args_consistency() {
1782 // This may modify compiler flags. Must be called before CompilerConfig::check_args_consistency()
1783 if (!CDSConfig::check_vm_args_consistency(patch_mod_javabase, mode_flag_cmd_line)) {
1784 return false;
1785 }
1786
1787 // Method for adding checks for flag consistency.
1788 // The intent is to warn the user of all possible conflicts,
1789 // before returning an error.
1790 // Note: Needs platform-dependent factoring.
1791 bool status = true;
1792
1793 if (TLABRefillWasteFraction == 0) {
1794 jio_fprintf(defaultStream::error_stream(),
1795 "TLABRefillWasteFraction should be a denominator, "
1796 "not %zu\n",
1797 TLABRefillWasteFraction);
1798 status = false;
1799 }
1800
1801 status = CompilerConfig::check_args_consistency(status);
1802 #if INCLUDE_JVMCI
1803 if (status && EnableJVMCI) {
2943 if (FLAG_IS_DEFAULT(UseLargePages) &&
2944 MaxHeapSize < LargePageHeapSizeThreshold) {
2945 // No need for large granularity pages w/small heaps.
2946 // Note that large pages are enabled/disabled for both the
2947 // Java heap and the code cache.
2948 FLAG_SET_DEFAULT(UseLargePages, false);
2949 }
2950
2951 UNSUPPORTED_OPTION(ProfileInterpreter);
2952 #endif
2953
2954 // Parse the CompilationMode flag
2955 if (!CompilationModeFlag::initialize()) {
2956 return JNI_ERR;
2957 }
2958
2959 if (!check_vm_args_consistency()) {
2960 return JNI_ERR;
2961 }
2962
2963
2964 #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
2965 UNSUPPORTED_OPTION(ShowRegistersOnAssert);
2966 #endif // CAN_SHOW_REGISTERS_ON_ASSERT
2967
2968 return JNI_OK;
2969 }
2970
2971 // Helper class for controlling the lifetime of JavaVMInitArgs
2972 // objects. The contents of the JavaVMInitArgs are guaranteed to be
2973 // deleted on the destruction of the ScopedVMInitArgs object.
2974 class ScopedVMInitArgs : public StackObj {
2975 private:
2976 JavaVMInitArgs _args;
2977 char* _container_name;
2978 bool _is_set;
2979 char* _vm_options_file_arg;
2980
2981 public:
2982 ScopedVMInitArgs(const char *container_name) {
3719
3720 // Set compiler flags after GC is selected and GC specific
3721 // flags (LoopStripMiningIter) are set.
3722 CompilerConfig::ergo_initialize();
3723
3724 // Set bytecode rewriting flags
3725 set_bytecode_flags();
3726
3727 // Set flags if aggressive optimization flags are enabled
3728 jint code = set_aggressive_opts_flags();
3729 if (code != JNI_OK) {
3730 return code;
3731 }
3732
3733 if (FLAG_IS_DEFAULT(UseSecondarySupersTable)) {
3734 FLAG_SET_DEFAULT(UseSecondarySupersTable, VM_Version::supports_secondary_supers_table());
3735 } else if (UseSecondarySupersTable && !VM_Version::supports_secondary_supers_table()) {
3736 warning("UseSecondarySupersTable is not supported");
3737 FLAG_SET_DEFAULT(UseSecondarySupersTable, false);
3738 }
3739 if (!UseSecondarySupersTable) {
3740 FLAG_SET_DEFAULT(StressSecondarySupers, false);
3741 FLAG_SET_DEFAULT(VerifySecondarySupers, false);
3742 }
3743
3744 #ifdef ZERO
3745 // Clear flags not supported on zero.
3746 FLAG_SET_DEFAULT(ProfileInterpreter, false);
3747 #endif // ZERO
3748
3749 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
3750 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
3751 DebugNonSafepoints = true;
3752 }
3753
3754 if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
3755 warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
3756 }
3757
3758 // Treat the odd case where local verification is enabled but remote
3780 warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
3781 }
3782 FLAG_SET_DEFAULT(EnableVectorReboxing, false);
3783
3784 if (!FLAG_IS_DEFAULT(EnableVectorAggressiveReboxing) && EnableVectorAggressiveReboxing) {
3785 if (!EnableVectorReboxing) {
3786 warning("Disabling EnableVectorAggressiveReboxing since EnableVectorReboxing is turned off.");
3787 } else {
3788 warning("Disabling EnableVectorAggressiveReboxing since EnableVectorSupport is turned off.");
3789 }
3790 }
3791 FLAG_SET_DEFAULT(EnableVectorAggressiveReboxing, false);
3792
3793 if (!FLAG_IS_DEFAULT(UseVectorStubs) && UseVectorStubs) {
3794 warning("Disabling UseVectorStubs since EnableVectorSupport is turned off.");
3795 }
3796 FLAG_SET_DEFAULT(UseVectorStubs, false);
3797 }
3798 #endif // COMPILER2_OR_JVMCI
3799
3800 if (log_is_enabled(Info, perf, class, link)) {
3801 if (!UsePerfData) {
3802 warning("Disabling -Xlog:perf+class+link since UsePerfData is turned off.");
3803 LogConfiguration::configure_stdout(LogLevel::Off, false, LOG_TAGS(perf, class, link));
3804 }
3805 }
3806
3807 if (FLAG_IS_CMDLINE(DiagnoseSyncOnValueBasedClasses)) {
3808 if (DiagnoseSyncOnValueBasedClasses == ObjectSynchronizer::LOG_WARNING && !log_is_enabled(Info, valuebasedclasses)) {
3809 LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(valuebasedclasses));
3810 }
3811 }
3812 return JNI_OK;
3813 }
3814
3815 jint Arguments::adjust_after_os() {
3816 if (UseNUMA) {
3817 if (UseParallelGC) {
3818 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3819 FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3820 }
3821 }
3822 }
3823 return JNI_OK;
3824 }
3825
|
1763 return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
1764 }
1765
1766 bool Arguments::sun_java_launcher_is_altjvm() {
1767 return _sun_java_launcher_is_altjvm;
1768 }
1769
1770 //===========================================================================================================
1771 // Parsing of main arguments
1772
1773 static unsigned int addreads_count = 0;
1774 static unsigned int addexports_count = 0;
1775 static unsigned int addopens_count = 0;
1776 static unsigned int patch_mod_count = 0;
1777 static unsigned int enable_native_access_count = 0;
1778 static bool patch_mod_javabase = false;
1779
1780 // Check the consistency of vm_init_args
1781 bool Arguments::check_vm_args_consistency() {
1782 // This may modify compiler flags. Must be called before CompilerConfig::check_args_consistency()
1783 if (!CDSConfig::check_vm_args_consistency(patch_mod_javabase, mode_flag_cmd_line, xshare_auto_cmd_line)) {
1784 return false;
1785 }
1786
1787 // Method for adding checks for flag consistency.
1788 // The intent is to warn the user of all possible conflicts,
1789 // before returning an error.
1790 // Note: Needs platform-dependent factoring.
1791 bool status = true;
1792
1793 if (TLABRefillWasteFraction == 0) {
1794 jio_fprintf(defaultStream::error_stream(),
1795 "TLABRefillWasteFraction should be a denominator, "
1796 "not %zu\n",
1797 TLABRefillWasteFraction);
1798 status = false;
1799 }
1800
1801 status = CompilerConfig::check_args_consistency(status);
1802 #if INCLUDE_JVMCI
1803 if (status && EnableJVMCI) {
2943 if (FLAG_IS_DEFAULT(UseLargePages) &&
2944 MaxHeapSize < LargePageHeapSizeThreshold) {
2945 // No need for large granularity pages w/small heaps.
2946 // Note that large pages are enabled/disabled for both the
2947 // Java heap and the code cache.
2948 FLAG_SET_DEFAULT(UseLargePages, false);
2949 }
2950
2951 UNSUPPORTED_OPTION(ProfileInterpreter);
2952 #endif
2953
2954 // Parse the CompilationMode flag
2955 if (!CompilationModeFlag::initialize()) {
2956 return JNI_ERR;
2957 }
2958
2959 if (!check_vm_args_consistency()) {
2960 return JNI_ERR;
2961 }
2962
2963 if (StoreCachedCode) {
2964 FLAG_SET_ERGO_IF_DEFAULT(CachedCodeMaxSize, 512*M);
2965 }
2966
2967 #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
2968 UNSUPPORTED_OPTION(ShowRegistersOnAssert);
2969 #endif // CAN_SHOW_REGISTERS_ON_ASSERT
2970
2971 return JNI_OK;
2972 }
2973
2974 // Helper class for controlling the lifetime of JavaVMInitArgs
2975 // objects. The contents of the JavaVMInitArgs are guaranteed to be
2976 // deleted on the destruction of the ScopedVMInitArgs object.
2977 class ScopedVMInitArgs : public StackObj {
2978 private:
2979 JavaVMInitArgs _args;
2980 char* _container_name;
2981 bool _is_set;
2982 char* _vm_options_file_arg;
2983
2984 public:
2985 ScopedVMInitArgs(const char *container_name) {
3722
3723 // Set compiler flags after GC is selected and GC specific
3724 // flags (LoopStripMiningIter) are set.
3725 CompilerConfig::ergo_initialize();
3726
3727 // Set bytecode rewriting flags
3728 set_bytecode_flags();
3729
3730 // Set flags if aggressive optimization flags are enabled
3731 jint code = set_aggressive_opts_flags();
3732 if (code != JNI_OK) {
3733 return code;
3734 }
3735
3736 if (FLAG_IS_DEFAULT(UseSecondarySupersTable)) {
3737 FLAG_SET_DEFAULT(UseSecondarySupersTable, VM_Version::supports_secondary_supers_table());
3738 } else if (UseSecondarySupersTable && !VM_Version::supports_secondary_supers_table()) {
3739 warning("UseSecondarySupersTable is not supported");
3740 FLAG_SET_DEFAULT(UseSecondarySupersTable, false);
3741 }
3742 UseSecondarySupersTable = false; // FIXME: Disabled for Leyden. Neet to fix SCAddressTable::id_for_address()
3743 if (!UseSecondarySupersTable) {
3744 FLAG_SET_DEFAULT(StressSecondarySupers, false);
3745 FLAG_SET_DEFAULT(VerifySecondarySupers, false);
3746 }
3747
3748 #ifdef ZERO
3749 // Clear flags not supported on zero.
3750 FLAG_SET_DEFAULT(ProfileInterpreter, false);
3751 #endif // ZERO
3752
3753 if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
3754 warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
3755 DebugNonSafepoints = true;
3756 }
3757
3758 if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
3759 warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
3760 }
3761
3762 // Treat the odd case where local verification is enabled but remote
3784 warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
3785 }
3786 FLAG_SET_DEFAULT(EnableVectorReboxing, false);
3787
3788 if (!FLAG_IS_DEFAULT(EnableVectorAggressiveReboxing) && EnableVectorAggressiveReboxing) {
3789 if (!EnableVectorReboxing) {
3790 warning("Disabling EnableVectorAggressiveReboxing since EnableVectorReboxing is turned off.");
3791 } else {
3792 warning("Disabling EnableVectorAggressiveReboxing since EnableVectorSupport is turned off.");
3793 }
3794 }
3795 FLAG_SET_DEFAULT(EnableVectorAggressiveReboxing, false);
3796
3797 if (!FLAG_IS_DEFAULT(UseVectorStubs) && UseVectorStubs) {
3798 warning("Disabling UseVectorStubs since EnableVectorSupport is turned off.");
3799 }
3800 FLAG_SET_DEFAULT(UseVectorStubs, false);
3801 }
3802 #endif // COMPILER2_OR_JVMCI
3803
3804 if (log_is_enabled(Info, init)) {
3805 if (FLAG_IS_DEFAULT(ProfileVMLocks)) {
3806 FLAG_SET_DEFAULT(ProfileVMLocks, true);
3807 }
3808 if (UsePerfData && !log_is_enabled(Info, perf, class, link)) {
3809 // automatically enable -Xlog:perf+class+link
3810 LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(perf, class, link));
3811 }
3812 // Don't turn on ProfileVMCalls and ProfileRuntimeCalls by default.
3813 } else {
3814 if (!FLAG_IS_DEFAULT(ProfileVMLocks) && ProfileVMLocks) {
3815 warning("Disabling ProfileVMLocks since logging is turned off.");
3816 FLAG_SET_DEFAULT(ProfileVMLocks, false);
3817 }
3818 if (!FLAG_IS_DEFAULT(ProfileVMCalls) && ProfileVMCalls) {
3819 warning("Disabling ProfileVMCalls since logging is turned off.");
3820 FLAG_SET_DEFAULT(ProfileVMCalls, false);
3821 }
3822 if (!FLAG_IS_DEFAULT(ProfileRuntimeCalls) && ProfileRuntimeCalls) {
3823 warning("Disabling ProfileRuntimeCalls since logging is turned off.");
3824 FLAG_SET_DEFAULT(ProfileRuntimeCalls, false);
3825 }
3826 if (log_is_enabled(Info, perf, class, link)) {
3827 warning("Disabling -Xlog:perf+class+link since logging is turned off.");
3828 LogConfiguration::configure_stdout(LogLevel::Off, false, LOG_TAGS(perf, class, link));
3829 }
3830 }
3831 if (FLAG_IS_DEFAULT(PerfDataMemorySize)) {
3832 if (ProfileVMLocks || ProfileVMCalls || ProfileRuntimeCalls) {
3833 FLAG_SET_DEFAULT(PerfDataMemorySize, 128*K); // reserve more space for extra perf counters
3834 }
3835 }
3836
3837 if (FLAG_IS_CMDLINE(DiagnoseSyncOnValueBasedClasses)) {
3838 if (DiagnoseSyncOnValueBasedClasses == ObjectSynchronizer::LOG_WARNING && !log_is_enabled(Info, valuebasedclasses)) {
3839 LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(valuebasedclasses));
3840 }
3841 }
3842 return JNI_OK;
3843 }
3844
3845 jint Arguments::adjust_after_os() {
3846 if (UseNUMA) {
3847 if (UseParallelGC) {
3848 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3849 FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3850 }
3851 }
3852 }
3853 return JNI_OK;
3854 }
3855
|