Mercurial > hg > graal-compiler
diff src/share/vm/runtime/arguments.cpp @ 7482:989155e2d07a
Merge with hs25-b15.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 16 Jan 2013 01:34:24 +0100 |
parents | 2912b72d840a f1c06dcee0b5 |
children | 3ac7d10a6572 |
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp Tue Jan 15 18:54:02 2013 +0100 +++ b/src/share/vm/runtime/arguments.cpp Wed Jan 16 01:34:24 2013 +0100 @@ -1101,10 +1101,6 @@ } } -// If the user has chosen ParallelGCThreads > 0, we set UseParNewGC -// if it's not explictly set or unset. If the user has chosen -// UseParNewGC and not explicitly set ParallelGCThreads we -// set it, unless this is a single cpu machine. void Arguments::set_parnew_gc_flags() { assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC, "control point invariant"); @@ -1113,42 +1109,41 @@ // Turn off AdaptiveSizePolicy for parnew until it is complete. disable_adaptive_size_policy("UseParNewGC"); - if (ParallelGCThreads == 0) { - FLAG_SET_DEFAULT(ParallelGCThreads, - Abstract_VM_Version::parallel_worker_threads()); - if (ParallelGCThreads == 1) { - FLAG_SET_DEFAULT(UseParNewGC, false); - FLAG_SET_DEFAULT(ParallelGCThreads, 0); - } + if (FLAG_IS_DEFAULT(ParallelGCThreads)) { + FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads()); + assert(ParallelGCThreads > 0, "We should always have at least one thread by default"); + } else if (ParallelGCThreads == 0) { + jio_fprintf(defaultStream::error_stream(), + "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n"); + vm_exit(1); + } + + // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively, + // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration + // we set them to 1024 and 1024. + // See CR 6362902. + if (FLAG_IS_DEFAULT(YoungPLABSize)) { + FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024); } - if (UseParNewGC) { - // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively, - // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration - // we set them to 1024 and 1024. - // See CR 6362902. - if (FLAG_IS_DEFAULT(YoungPLABSize)) { - FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024); + if (FLAG_IS_DEFAULT(OldPLABSize)) { + FLAG_SET_DEFAULT(OldPLABSize, (intx)1024); + } + + // AlwaysTenure flag should make ParNew promote all at first collection. + // See CR 6362902. + if (AlwaysTenure) { + FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0); + } + // When using compressed oops, we use local overflow stacks, + // rather than using a global overflow list chained through + // the klass word of the object's pre-image. + if (UseCompressedOops && !ParGCUseLocalOverflow) { + if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) { + warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references"); } - if (FLAG_IS_DEFAULT(OldPLABSize)) { - FLAG_SET_DEFAULT(OldPLABSize, (intx)1024); - } - - // AlwaysTenure flag should make ParNew promote all at first collection. - // See CR 6362902. - if (AlwaysTenure) { - FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0); - } - // When using compressed oops, we use local overflow stacks, - // rather than using a global overflow list chained through - // the klass word of the object's pre-image. - if (UseCompressedOops && !ParGCUseLocalOverflow) { - if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) { - warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references"); - } - FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true); - } - assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error"); + FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true); } + assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error"); } // Adjust some sizes to suit CMS and/or ParNew needs; these work well on @@ -1349,14 +1344,14 @@ // then a saved space from compressed oops. if ((int)ObjectAlignmentInBytes > 256) { jio_fprintf(defaultStream::error_stream(), - "error: ObjectAlignmentInBytes=%d must not be greater then 256\n", + "error: ObjectAlignmentInBytes=%d must not be greater than 256\n", (int)ObjectAlignmentInBytes); return false; } // In case page size is very small. if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) { jio_fprintf(defaultStream::error_stream(), - "error: ObjectAlignmentInBytes=%d must be less then page size %d\n", + "error: ObjectAlignmentInBytes=%d must be less than page size %d\n", (int)ObjectAlignmentInBytes, os::vm_page_size()); return false; } @@ -1477,30 +1472,34 @@ // 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_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 + - // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. - // See CR 6362902 for details. - if (!FLAG_IS_DEFAULT(SurvivorRatio)) { - if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) { - FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2); - } - if (FLAG_IS_DEFAULT(MinSurvivorRatio)) { - FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2); - } + FLAG_SET_DEFAULT(ParallelGCThreads, + Abstract_VM_Version::parallel_worker_threads()); + if (ParallelGCThreads == 0) { + jio_fprintf(defaultStream::error_stream(), + "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n"); + vm_exit(1); + } + + + // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the + // SurvivorRatio has been set, reset their default values to SurvivorRatio + + // 2. By doing this we make SurvivorRatio also work for Parallel Scavenger. + // See CR 6362902 for details. + if (!FLAG_IS_DEFAULT(SurvivorRatio)) { + if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) { + FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2); } - - if (UseParallelOldGC) { - // Par compact uses lower default values since they are treated as - // minimums. These are different defaults because of the different - // interpretation and are not ergonomically set. - if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) { - FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1); - } + if (FLAG_IS_DEFAULT(MinSurvivorRatio)) { + FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2); + } + } + + if (UseParallelOldGC) { + // Par compact uses lower default values since they are treated as + // minimums. These are different defaults because of the different + // interpretation and are not ergonomically set. + if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) { + FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1); } } } @@ -1517,13 +1516,12 @@ Abstract_VM_Version::parallel_worker_threads()); } - if (FLAG_IS_DEFAULT(MarkStackSize)) { - FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE); - } - if (PrintGCDetails && Verbose) { - tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", - MarkStackSize / K, MarkStackSizeMax / K); - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); + // MarkStackSize will be set (if it hasn't been set by the user) + // when concurrent marking is initialized. + // Its value will be based upon the number of parallel marking threads. + // But we do set the maximum mark stack size here. + if (FLAG_IS_DEFAULT(MarkStackSizeMax)) { + FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE); } if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) { @@ -1535,6 +1533,12 @@ // is allocation). We might consider increase it further. FLAG_SET_DEFAULT(GCTimeRatio, 9); } + + if (PrintGCDetails && Verbose) { + tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", + MarkStackSize / K, MarkStackSizeMax / K); + tty->print_cr("ConcGCThreads: %u", ConcGCThreads); + } } void Arguments::set_heap_size() { @@ -1796,6 +1800,24 @@ return status; } +void Arguments::check_deprecated_gcs() { + if (UseConcMarkSweepGC && !UseParNewGC) { + warning("Using the DefNew young collector with the CMS collector is deprecated " + "and will likely be removed in a future release"); + } + + if (UseParNewGC && !UseConcMarkSweepGC) { + // !UseConcMarkSweepGC means that we are using serial old gc. Unfortunately we don't + // set up UseSerialGC properly, so that can't be used in the check here. + warning("Using the ParNew young collector with the Serial old collector is deprecated " + "and will likely be removed in a future release"); + } + + if (CMSIncrementalMode) { + warning("Using incremental CMS is deprecated and will likely be removed in a future release"); + } +} + // Check stack pages settings bool Arguments::check_stack_pages() { @@ -1998,6 +2020,9 @@ status = status && verify_min_value(ClassMetaspaceSize, 1*M, "ClassMetaspaceSize"); + status = status && verify_interval(MarkStackSizeMax, + 1, (max_jint - 1), "MarkStackSizeMax"); + #ifdef SPARC if (UseConcMarkSweepGC || UseG1GC) { // Issue a stern warning if the user has explicitly set @@ -3169,11 +3194,6 @@ FLAG_SET_DEFAULT(UseLargePages, false); } - // Add 2M to any size for SharedReadOnlySize to get around the JPRT setting - if (DumpSharedSpaces && !FLAG_IS_DEFAULT(SharedReadOnlySize)) { - SharedReadOnlySize = 14*M; - } - if (DumpSharedSpaces) { if (RequireSharedSpaces) { warning("cannot dump shared archive while using shared archive"); @@ -3210,7 +3230,6 @@ strcpy(shared_archive_path, jvm_path); strcat(shared_archive_path, os::file_separator()); strcat(shared_archive_path, "classes"); - DEBUG_ONLY(strcat(shared_archive_path, "_g");) strcat(shared_archive_path, ".jsa"); SharedArchivePath = shared_archive_path; @@ -3419,6 +3438,7 @@ } else if (UseG1GC) { set_g1_gc_flags(); } + check_deprecated_gcs(); #endif // INCLUDE_ALTERNATE_GCS #ifdef SERIALGC @@ -3466,6 +3486,18 @@ if (!EliminateLocks) { EliminateNestedLocks = false; } + if (!Inline) { + IncrementalInline = false; + } +#ifndef PRODUCT + if (!IncrementalInline) { + AlwaysIncrementalInline = false; + } +#endif + if (IncrementalInline && FLAG_IS_DEFAULT(MaxNodeLimit)) { + // incremental inlining: bump MaxNodeLimit + FLAG_SET_DEFAULT(MaxNodeLimit, (intx)75000); + } #endif if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {