--- old/src/share/vm/runtime/arguments.cpp 2015-10-14 13:54:33.356426707 +0200 +++ new/src/share/vm/runtime/arguments.cpp 2015-10-14 13:54:33.221429972 +0200 @@ -51,6 +51,7 @@ #include "utilities/macros.hpp" #include "utilities/stringUtils.hpp" #if INCLUDE_ALL_GCS +#include "gc/shenandoah/shenandoahHeap.hpp" #include "gc/cms/compactibleFreeListSpace.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" @@ -1471,6 +1472,11 @@ // the only value that can override MaxHeapSize if we are // to use UseCompressedOops is InitialHeapSize. size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize); + if (UseShenandoahGC && FLAG_IS_DEFAULT(UseCompressedOops)) { + warning("Compressed Oops not supported with ShenandoahGC"); + FLAG_SET_ERGO(bool, UseCompressedOops, false); + FLAG_SET_ERGO(bool, UseCompressedClassPointers, false); + } if (max_heap_size <= max_heap_for_compressed_oops()) { #if !defined(COMPILER1) || defined(TIERED) @@ -1529,6 +1535,10 @@ heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment(); } else if (UseG1GC) { heap_alignment = G1CollectedHeap::conservative_max_heap_alignment(); + } else if (UseShenandoahGC) { + // TODO: This sucks. Can't we have a clean interface to call the GC's collector + // policy for this? + heap_alignment = ShenandoahHeap::conservative_max_heap_alignment(); } #endif // INCLUDE_ALL_GCS _conservative_max_heap_alignment = MAX4(heap_alignment, @@ -1687,6 +1697,21 @@ } } +void Arguments::set_shenandoah_gc_flags() { + FLAG_SET_DEFAULT(UseDynamicNumberOfGCThreads, true); + FLAG_SET_DEFAULT(ParallelGCThreads, + Abstract_VM_Version::parallel_worker_threads()); + + if (FLAG_IS_DEFAULT(ConcGCThreads)) { + uint conc_threads = MAX2((uint) 1, ParallelGCThreads); + FLAG_SET_DEFAULT(ConcGCThreads, conc_threads); + } + + if (FLAG_IS_DEFAULT(ParallelRefProcEnabled)) { + FLAG_SET_DEFAULT(ParallelRefProcEnabled, true); + } +} + #if !INCLUDE_ALL_GCS #ifdef ASSERT static bool verify_serial_gc_flags() { @@ -1706,6 +1731,8 @@ set_cms_and_parnew_gc_flags(); } else if (UseG1GC) { set_g1_gc_flags(); + } else if (UseShenandoahGC) { + set_shenandoah_gc_flags(); } check_deprecated_gc_flags(); if (AssumeMP && !UseSerialGC) {