1 /* 2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 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 "gc/z/zArguments.hpp" 27 #include "gc/z/zCollectedHeap.hpp" 28 #include "gc/z/zCollectorPolicy.hpp" 29 #include "gc/z/zWorkers.hpp" 30 #include "gc/shared/gcArguments.inline.hpp" 31 #include "runtime/globals.hpp" 32 #include "runtime/globals_extension.hpp" 33 34 size_t ZArguments::conservative_max_heap_alignment() { 35 return 0; 36 } 37 38 void ZArguments::initialize() { 39 GCArguments::initialize(); 40 41 // Enable NUMA by default 42 if (FLAG_IS_DEFAULT(UseNUMA)) { 43 FLAG_SET_DEFAULT(UseNUMA, true); 44 } 45 46 // Disable biased locking by default 47 if (FLAG_IS_DEFAULT(UseBiasedLocking)) { 48 FLAG_SET_DEFAULT(UseBiasedLocking, false); 49 } 50 51 // Select number of parallel threads 52 if (FLAG_IS_DEFAULT(ParallelGCThreads)) { 53 FLAG_SET_DEFAULT(ParallelGCThreads, ZWorkers::calculate_nparallel()); 54 } 55 56 // Select number of concurrent threads 57 if (FLAG_IS_DEFAULT(ConcGCThreads)) { 58 FLAG_SET_DEFAULT(ConcGCThreads, ZWorkers::calculate_nconcurrent()); 59 } 60 61 #ifdef COMPILER2 62 // Enable loop strip mining by default 63 if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) { 64 FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true); 65 #if 0 66 if (FLAG_IS_DEFAULT(LoopStripMiningIter)) { 67 FLAG_SET_DEFAULT(LoopStripMiningIter, 1000); 68 } 69 #else 70 // NOTE! Loop strip mining is temporarily disabled 71 // until JDK-8193935 and JDK-8201532 have be fixed 72 FLAG_SET_DEFAULT(LoopStripMiningIter, 1); 73 #endif 74 } 75 #endif 76 77 // To avoid asserts in set_active_workers() 78 FLAG_SET_DEFAULT(UseDynamicNumberOfGCThreads, true); 79 80 // CompressedOops/UseCompressedClassPointers not supported 81 FLAG_SET_DEFAULT(UseCompressedOops, false); 82 FLAG_SET_DEFAULT(UseCompressedClassPointers, false); 83 84 // Verification before exit not (yet) supported 85 FLAG_SET_DEFAULT(VerifyBeforeExit, false); 86 } 87 88 CollectedHeap* ZArguments::create_heap() { 89 return create_heap_with_policy<ZCollectedHeap, ZCollectorPolicy>(); 90 }