1743 // The conservative maximum required alignment for the heap is the maximum of
1744 // the alignments imposed by several sources: any requirements from the heap
1745 // itself, the collector policy and the maximum page size we may run the VM
1746 // with.
1747 size_t heap_alignment = GenCollectedHeap::conservative_max_heap_alignment();
1748 #if INCLUDE_ALL_GCS
1749 if (UseParallelGC) {
1750 heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1751 } else if (UseG1GC) {
1752 heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
1753 }
1754 #endif // INCLUDE_ALL_GCS
1755 _conservative_max_heap_alignment = MAX4(heap_alignment,
1756 (size_t)os::vm_allocation_granularity(),
1757 os::max_page_size(),
1758 CollectorPolicy::compute_heap_alignment());
1759 }
1760
1761 bool Arguments::gc_selected() {
1762 #if INCLUDE_ALL_GCS
1763 return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC;
1764 #else
1765 return UseSerialGC;
1766 #endif // INCLUDE_ALL_GCS
1767 }
1768
1769 void Arguments::select_gc_ergonomically() {
1770 #if INCLUDE_ALL_GCS
1771 if (os::is_server_class_machine()) {
1772 FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
1773 } else {
1774 FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
1775 }
1776 #else
1777 UNSUPPORTED_OPTION(UseG1GC);
1778 UNSUPPORTED_OPTION(UseParallelGC);
1779 UNSUPPORTED_OPTION(UseParallelOldGC);
1780 UNSUPPORTED_OPTION(UseConcMarkSweepGC);
1781 FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
1782 #endif // INCLUDE_ALL_GCS
1783 }
2287
2288 //===========================================================================================================
2289 // Parsing of main arguments
2290
2291 #if INCLUDE_JVMCI
2292 // Check consistency of jvmci vm argument settings.
2293 bool Arguments::check_jvmci_args_consistency() {
2294 return JVMCIGlobals::check_jvmci_flags_are_consistent();
2295 }
2296 #endif //INCLUDE_JVMCI
2297
2298 // Check consistency of GC selection
2299 bool Arguments::check_gc_consistency() {
2300 // Ensure that the user has not selected conflicting sets
2301 // of collectors.
2302 uint i = 0;
2303 if (UseSerialGC) i++;
2304 if (UseConcMarkSweepGC) i++;
2305 if (UseParallelGC || UseParallelOldGC) i++;
2306 if (UseG1GC) i++;
2307 if (i > 1) {
2308 jio_fprintf(defaultStream::error_stream(),
2309 "Conflicting collector combinations in option list; "
2310 "please refer to the release notes for the combinations "
2311 "allowed\n");
2312 return false;
2313 }
2314
2315 return true;
2316 }
2317
2318 // Check the consistency of vm_init_args
2319 bool Arguments::check_vm_args_consistency() {
2320 // Method for adding checks for flag consistency.
2321 // The intent is to warn the user of all possible conflicts,
2322 // before returning an error.
2323 // Note: Needs platform-dependent factoring.
2324 bool status = true;
2325
2326 if (TLABRefillWasteFraction == 0) {
|
1743 // The conservative maximum required alignment for the heap is the maximum of
1744 // the alignments imposed by several sources: any requirements from the heap
1745 // itself, the collector policy and the maximum page size we may run the VM
1746 // with.
1747 size_t heap_alignment = GenCollectedHeap::conservative_max_heap_alignment();
1748 #if INCLUDE_ALL_GCS
1749 if (UseParallelGC) {
1750 heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1751 } else if (UseG1GC) {
1752 heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
1753 }
1754 #endif // INCLUDE_ALL_GCS
1755 _conservative_max_heap_alignment = MAX4(heap_alignment,
1756 (size_t)os::vm_allocation_granularity(),
1757 os::max_page_size(),
1758 CollectorPolicy::compute_heap_alignment());
1759 }
1760
1761 bool Arguments::gc_selected() {
1762 #if INCLUDE_ALL_GCS
1763 return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC || UseEpsilonGC;
1764 #else
1765 return UseSerialGC;
1766 #endif // INCLUDE_ALL_GCS
1767 }
1768
1769 void Arguments::select_gc_ergonomically() {
1770 #if INCLUDE_ALL_GCS
1771 if (os::is_server_class_machine()) {
1772 FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
1773 } else {
1774 FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
1775 }
1776 #else
1777 UNSUPPORTED_OPTION(UseG1GC);
1778 UNSUPPORTED_OPTION(UseParallelGC);
1779 UNSUPPORTED_OPTION(UseParallelOldGC);
1780 UNSUPPORTED_OPTION(UseConcMarkSweepGC);
1781 FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
1782 #endif // INCLUDE_ALL_GCS
1783 }
2287
2288 //===========================================================================================================
2289 // Parsing of main arguments
2290
2291 #if INCLUDE_JVMCI
2292 // Check consistency of jvmci vm argument settings.
2293 bool Arguments::check_jvmci_args_consistency() {
2294 return JVMCIGlobals::check_jvmci_flags_are_consistent();
2295 }
2296 #endif //INCLUDE_JVMCI
2297
2298 // Check consistency of GC selection
2299 bool Arguments::check_gc_consistency() {
2300 // Ensure that the user has not selected conflicting sets
2301 // of collectors.
2302 uint i = 0;
2303 if (UseSerialGC) i++;
2304 if (UseConcMarkSweepGC) i++;
2305 if (UseParallelGC || UseParallelOldGC) i++;
2306 if (UseG1GC) i++;
2307 if (UseEpsilonGC) i++;
2308 if (i > 1) {
2309 jio_fprintf(defaultStream::error_stream(),
2310 "Conflicting collector combinations in option list; "
2311 "please refer to the release notes for the combinations "
2312 "allowed\n");
2313 return false;
2314 }
2315
2316 return true;
2317 }
2318
2319 // Check the consistency of vm_init_args
2320 bool Arguments::check_vm_args_consistency() {
2321 // Method for adding checks for flag consistency.
2322 // The intent is to warn the user of all possible conflicts,
2323 // before returning an error.
2324 // Note: Needs platform-dependent factoring.
2325 bool status = true;
2326
2327 if (TLABRefillWasteFraction == 0) {
|