Mercurial > hg > graal-jvmci-8
diff src/share/vm/runtime/arguments.cpp @ 4137:04b9a2566eec
Merge with hsx23/hotspot.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 17 Dec 2011 21:40:27 +0100 |
parents | d3ec27ea1b20 55d777c0860a |
children | 394404b2d9bd |
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp Sat Dec 17 20:50:09 2011 +0100 +++ b/src/share/vm/runtime/arguments.cpp Sat Dec 17 21:40:27 2011 +0100 @@ -37,15 +37,6 @@ #include "services/management.hpp" #include "utilities/defaultStream.hpp" #include "utilities/taskqueue.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif #ifdef TARGET_OS_FAMILY_linux # include "os_linux.inline.hpp" #endif @@ -55,6 +46,9 @@ #ifdef TARGET_OS_FAMILY_windows # include "os_windows.inline.hpp" #endif +#ifdef TARGET_OS_FAMILY_bsd +# include "os_bsd.inline.hpp" +#endif #ifndef SERIALGC #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" #endif @@ -256,6 +250,11 @@ { "UseParallelOldGCDensePrefix", JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, { "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) }, + { "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) }, +#ifdef PRODUCT + { "DesiredMethodLimit", + JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, +#endif // PRODUCT { NULL, JDK_Version(0), JDK_Version(0) } }; @@ -1369,9 +1368,12 @@ // by ergonomics. if (MaxHeapSize <= max_heap_for_compressed_oops()) { #if !defined(COMPILER1) || defined(TIERED) +// disable UseCompressedOops by default on MacOS X until 7118647 is fixed +#ifndef __APPLE__ if (FLAG_IS_DEFAULT(UseCompressedOops)) { FLAG_SET_ERGO(bool, UseCompressedOops, true); } +#endif // !__APPLE__ #endif #ifdef _WIN64 if (UseLargePages && UseCompressedOops) { @@ -1404,8 +1406,8 @@ // If no heap maximum was requested explicitly, use some reasonable fraction // of the physical memory, up to a maximum of 1GB. if (UseParallelGC) { - FLAG_SET_ERGO(uintx, ParallelGCThreads, - Abstract_VM_Version::parallel_worker_threads()); + FLAG_SET_DEFAULT(ParallelGCThreads, + Abstract_VM_Version::parallel_worker_threads()); // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the // SurvivorRatio has been set, reset their default values to SurvivorRatio + @@ -1436,6 +1438,9 @@ if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) { FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M); } + // For those collectors or operating systems (eg, Windows) that do + // not support full UseNUMA, we will map to UseNUMAInterleaving for now + UseNUMAInterleaving = true; } } @@ -1584,18 +1589,9 @@ sprintf(buffer, "java.lang.Integer.IntegerCache.high=" INTX_FORMAT, AutoBoxCacheMax); add_property(buffer); } - if (AggressiveOpts && FLAG_IS_DEFAULT(DoEscapeAnalysis)) { - FLAG_SET_DEFAULT(DoEscapeAnalysis, true); - } if (AggressiveOpts && FLAG_IS_DEFAULT(BiasedLockingStartupDelay)) { FLAG_SET_DEFAULT(BiasedLockingStartupDelay, 500); } - if (AggressiveOpts && FLAG_IS_DEFAULT(OptimizeStringConcat)) { - FLAG_SET_DEFAULT(OptimizeStringConcat, true); - } - if (AggressiveOpts && FLAG_IS_DEFAULT(OptimizeFill)) { - FLAG_SET_DEFAULT(OptimizeFill, true); - } #endif if (AggressiveOpts) { @@ -1689,8 +1685,33 @@ UseParallelGC || UseParallelOldGC)); } +// check if do gclog rotation +// +UseGCLogFileRotation is a must, +// no gc log rotation when log file not supplied or +// NumberOfGCLogFiles is 0, or GCLogFileSize is 0 +void check_gclog_consistency() { + if (UseGCLogFileRotation) { + if ((Arguments::gc_log_filename() == NULL) || + (NumberOfGCLogFiles == 0) || + (GCLogFileSize == 0)) { + jio_fprintf(defaultStream::output_stream(), + "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>\n" + "where num_of_file > 0 and num_of_size > 0\n" + "GC log rotation is turned off\n"); + UseGCLogFileRotation = false; + } + } + + if (UseGCLogFileRotation && GCLogFileSize < 8*K) { + FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K); + jio_fprintf(defaultStream::output_stream(), + "GCLogFileSize changed to minimum 8K\n"); + } +} + // Check consistency of GC selection bool Arguments::check_gc_consistency() { + check_gclog_consistency(); bool status = true; // Ensure that the user has not selected conflicting sets // of collectors. [Note: this check is merely a user convenience; @@ -2623,16 +2644,16 @@ FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false); FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true); } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) { -#ifdef SOLARIS +#if defined(DTRACE_ENABLED) FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true); FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true); FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true); FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true); -#else // ndef SOLARIS +#else // defined(DTRACE_ENABLED) jio_fprintf(defaultStream::error_stream(), - "ExtendedDTraceProbes flag is only applicable on Solaris\n"); + "ExtendedDTraceProbes flag is not applicable for this configuration\n"); return JNI_EINVAL; -#endif // ndef SOLARIS +#endif // defined(DTRACE_ENABLED) #ifdef ASSERT } else if (match_option(option, "-XX:+FullGCALot", &tail)) { FLAG_SET_CMDLINE(bool, FullGCALot, true); @@ -2727,6 +2748,7 @@ return JNI_ERR; } } + // Change the default value for flags which have different default values // when working with older JDKs. if (JDK_Version::current().compare_major(6) <= 0 && @@ -2941,6 +2963,18 @@ } } +// Disable options not supported in this release, with a warning if they +// were explicitly requested on the command-line +#define UNSUPPORTED_OPTION(opt, description) \ +do { \ + if (opt) { \ + if (FLAG_IS_CMDLINE(opt)) { \ + warning(description " is disabled in this release."); \ + } \ + FLAG_SET_DEFAULT(opt, false); \ + } \ +} while(0) + // Parse entry point called from JNI_CreateJavaVM jint Arguments::parse(const JavaVMInitArgs* args) { @@ -3038,6 +3072,10 @@ return result; } +#ifdef JAVASE_EMBEDDED + UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); +#endif + #ifndef PRODUCT if (TraceBytecodesAt != 0) { TraceBytecodes = true;