< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "cds/cds_globals.hpp"
  27 #include "cds/cdsConfig.hpp"
  28 #include "cds/filemap.hpp"

  29 #include "classfile/classLoader.hpp"
  30 #include "classfile/javaAssertions.hpp"
  31 #include "classfile/moduleEntry.hpp"
  32 #include "classfile/stringTable.hpp"
  33 #include "classfile/symbolTable.hpp"
  34 #include "compiler/compilerDefinitions.hpp"
  35 #include "gc/shared/gcArguments.hpp"
  36 #include "gc/shared/gcConfig.hpp"
  37 #include "gc/shared/stringdedup/stringDedup.hpp"
  38 #include "gc/shared/tlab_globals.hpp"
  39 #include "jvm.h"
  40 #include "logging/log.hpp"
  41 #include "logging/logConfiguration.hpp"
  42 #include "logging/logStream.hpp"
  43 #include "logging/logTag.hpp"
  44 #include "memory/allocation.inline.hpp"
  45 #include "nmt/nmtCommon.hpp"
  46 #include "oops/compressedKlass.hpp"
  47 #include "oops/instanceKlass.hpp"
  48 #include "oops/oop.inline.hpp"

1779 bool Arguments::check_vm_args_consistency() {
1780   // Method for adding checks for flag consistency.
1781   // The intent is to warn the user of all possible conflicts,
1782   // before returning an error.
1783   // Note: Needs platform-dependent factoring.
1784   bool status = true;
1785 
1786   if (TLABRefillWasteFraction == 0) {
1787     jio_fprintf(defaultStream::error_stream(),
1788                 "TLABRefillWasteFraction should be a denominator, "
1789                 "not " SIZE_FORMAT "\n",
1790                 TLABRefillWasteFraction);
1791     status = false;
1792   }
1793 
1794   status = CompilerConfig::check_args_consistency(status);
1795 #if INCLUDE_JVMCI
1796   if (status && EnableJVMCI) {
1797     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
1798         AddProperty, UnwriteableProperty, InternalProperty);
1799     if (ClassLoader::is_module_observable("jdk.internal.vm.ci")) {





1800       if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
1801         return false;
1802       }
1803     }
1804   }
1805 #endif
1806 
1807 #if INCLUDE_JFR
1808   if (status && (FlightRecorderOptions || StartFlightRecording)) {
1809     if (!create_numbered_module_property("jdk.module.addmods", "jdk.jfr", addmods_count++)) {
1810       return false;
1811     }
1812   }
1813 #endif
1814 
1815 #ifndef SUPPORT_RESERVED_STACK_AREA
1816   if (StackReservedPages != 0) {
1817     FLAG_SET_CMDLINE(StackReservedPages, 0);
1818     warning("Reserved Stack Area not supported on this platform");
1819   }

3712       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
3713     }
3714     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
3715 
3716     if (!FLAG_IS_DEFAULT(EnableVectorAggressiveReboxing) && EnableVectorAggressiveReboxing) {
3717       if (!EnableVectorReboxing) {
3718         warning("Disabling EnableVectorAggressiveReboxing since EnableVectorReboxing is turned off.");
3719       } else {
3720         warning("Disabling EnableVectorAggressiveReboxing since EnableVectorSupport is turned off.");
3721       }
3722     }
3723     FLAG_SET_DEFAULT(EnableVectorAggressiveReboxing, false);
3724 
3725     if (!FLAG_IS_DEFAULT(UseVectorStubs) && UseVectorStubs) {
3726       warning("Disabling UseVectorStubs since EnableVectorSupport is turned off.");
3727     }
3728     FLAG_SET_DEFAULT(UseVectorStubs, false);
3729   }
3730 #endif // COMPILER2_OR_JVMCI
3731 

























3732   if (FLAG_IS_CMDLINE(DiagnoseSyncOnValueBasedClasses)) {
3733     if (DiagnoseSyncOnValueBasedClasses == ObjectSynchronizer::LOG_WARNING && !log_is_enabled(Info, valuebasedclasses)) {
3734       LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(valuebasedclasses));
3735     }
3736   }
3737   return JNI_OK;
3738 }
3739 
3740 jint Arguments::adjust_after_os() {
3741   if (UseNUMA) {
3742     if (UseParallelGC) {
3743       if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3744          FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3745       }
3746     }
3747   }
3748   return JNI_OK;
3749 }
3750 
3751 int Arguments::PropertyList_count(SystemProperty* pl) {

   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "cds/cds_globals.hpp"
  27 #include "cds/cdsConfig.hpp"
  28 #include "cds/filemap.hpp"
  29 #include "cds/heapShared.hpp"
  30 #include "classfile/classLoader.hpp"
  31 #include "classfile/javaAssertions.hpp"
  32 #include "classfile/moduleEntry.hpp"
  33 #include "classfile/stringTable.hpp"
  34 #include "classfile/symbolTable.hpp"
  35 #include "compiler/compilerDefinitions.hpp"
  36 #include "gc/shared/gcArguments.hpp"
  37 #include "gc/shared/gcConfig.hpp"
  38 #include "gc/shared/stringdedup/stringDedup.hpp"
  39 #include "gc/shared/tlab_globals.hpp"
  40 #include "jvm.h"
  41 #include "logging/log.hpp"
  42 #include "logging/logConfiguration.hpp"
  43 #include "logging/logStream.hpp"
  44 #include "logging/logTag.hpp"
  45 #include "memory/allocation.inline.hpp"
  46 #include "nmt/nmtCommon.hpp"
  47 #include "oops/compressedKlass.hpp"
  48 #include "oops/instanceKlass.hpp"
  49 #include "oops/oop.inline.hpp"

1780 bool Arguments::check_vm_args_consistency() {
1781   // Method for adding checks for flag consistency.
1782   // The intent is to warn the user of all possible conflicts,
1783   // before returning an error.
1784   // Note: Needs platform-dependent factoring.
1785   bool status = true;
1786 
1787   if (TLABRefillWasteFraction == 0) {
1788     jio_fprintf(defaultStream::error_stream(),
1789                 "TLABRefillWasteFraction should be a denominator, "
1790                 "not " SIZE_FORMAT "\n",
1791                 TLABRefillWasteFraction);
1792     status = false;
1793   }
1794 
1795   status = CompilerConfig::check_args_consistency(status);
1796 #if INCLUDE_JVMCI
1797   if (status && EnableJVMCI) {
1798     PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
1799         AddProperty, UnwriteableProperty, InternalProperty);
1800     /*
1801      * Ioi - 2023/05/19. There's no need for this with my patch-jdk.sh script, which adds
1802      * jdk.internal.vm.ci as one of the default modules. Using -Djdk.module.addmods will
1803      * cause the full module graph to be disabled and slow down performance.
1804      */
1805     if (!TempDisableAddJVMCIModule && ClassLoader::is_module_observable("jdk.internal.vm.ci")) {
1806       if (!create_numbered_module_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
1807         return false;
1808       }
1809     }
1810   }
1811 #endif
1812 
1813 #if INCLUDE_JFR
1814   if (status && (FlightRecorderOptions || StartFlightRecording)) {
1815     if (!create_numbered_module_property("jdk.module.addmods", "jdk.jfr", addmods_count++)) {
1816       return false;
1817     }
1818   }
1819 #endif
1820 
1821 #ifndef SUPPORT_RESERVED_STACK_AREA
1822   if (StackReservedPages != 0) {
1823     FLAG_SET_CMDLINE(StackReservedPages, 0);
1824     warning("Reserved Stack Area not supported on this platform");
1825   }

3718       warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
3719     }
3720     FLAG_SET_DEFAULT(EnableVectorReboxing, false);
3721 
3722     if (!FLAG_IS_DEFAULT(EnableVectorAggressiveReboxing) && EnableVectorAggressiveReboxing) {
3723       if (!EnableVectorReboxing) {
3724         warning("Disabling EnableVectorAggressiveReboxing since EnableVectorReboxing is turned off.");
3725       } else {
3726         warning("Disabling EnableVectorAggressiveReboxing since EnableVectorSupport is turned off.");
3727       }
3728     }
3729     FLAG_SET_DEFAULT(EnableVectorAggressiveReboxing, false);
3730 
3731     if (!FLAG_IS_DEFAULT(UseVectorStubs) && UseVectorStubs) {
3732       warning("Disabling UseVectorStubs since EnableVectorSupport is turned off.");
3733     }
3734     FLAG_SET_DEFAULT(UseVectorStubs, false);
3735   }
3736 #endif // COMPILER2_OR_JVMCI
3737 
3738   if (log_is_enabled(Info, init)) {
3739     if (FLAG_IS_DEFAULT(ProfileVMLocks)) {
3740       FLAG_SET_DEFAULT(ProfileVMLocks, true);
3741     }
3742     // Don't turn on ProfileVMCalls and ProfileRuntimeCalls by default.
3743   } else {
3744     if (!FLAG_IS_DEFAULT(ProfileVMLocks) && ProfileVMLocks) {
3745       warning("Disabling ProfileVMLocks since logging is turned off.");
3746       FLAG_SET_DEFAULT(ProfileVMLocks, false);
3747     }
3748     if (!FLAG_IS_DEFAULT(ProfileVMCalls) && ProfileVMCalls) {
3749       warning("Disabling ProfileVMCalls since logging is turned off.");
3750       FLAG_SET_DEFAULT(ProfileVMCalls, false);
3751     }
3752     if (!FLAG_IS_DEFAULT(ProfileRuntimeCalls) && ProfileRuntimeCalls) {
3753       warning("Disabling ProfileRuntimeCalls since logging is turned off.");
3754       FLAG_SET_DEFAULT(ProfileRuntimeCalls, false);
3755     }
3756   }
3757   if (FLAG_IS_DEFAULT(PerfDataMemorySize)) {
3758     if (ProfileVMLocks || ProfileVMCalls || ProfileRuntimeCalls) {
3759       FLAG_SET_DEFAULT(PerfDataMemorySize, 128*K); // reserve more space for extra perf counters
3760     }
3761   }
3762 
3763   if (FLAG_IS_CMDLINE(DiagnoseSyncOnValueBasedClasses)) {
3764     if (DiagnoseSyncOnValueBasedClasses == ObjectSynchronizer::LOG_WARNING && !log_is_enabled(Info, valuebasedclasses)) {
3765       LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(valuebasedclasses));
3766     }
3767   }
3768   return JNI_OK;
3769 }
3770 
3771 jint Arguments::adjust_after_os() {
3772   if (UseNUMA) {
3773     if (UseParallelGC) {
3774       if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3775          FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3776       }
3777     }
3778   }
3779   return JNI_OK;
3780 }
3781 
3782 int Arguments::PropertyList_count(SystemProperty* pl) {
< prev index next >