55935
|
1 |
/*
|
56350
|
2 |
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
|
55935
|
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/epsilon/epsilonArguments.hpp"
|
55939
|
27 |
#include "gc/epsilon/epsilonHeap.hpp"
|
55935
|
28 |
#include "gc/epsilon/epsilonCollectorPolicy.hpp"
|
|
29 |
#include "gc/shared/gcArguments.inline.hpp"
|
|
30 |
#include "runtime/globals.hpp"
|
|
31 |
#include "runtime/globals_extension.hpp"
|
|
32 |
#include "runtime/vm_version.hpp"
|
|
33 |
|
|
34 |
size_t EpsilonArguments::conservative_max_heap_alignment() {
|
|
35 |
return UseLargePages ? os::large_page_size() : os::vm_page_size();
|
|
36 |
}
|
|
37 |
|
56422
|
38 |
void EpsilonArguments::initialize() {
|
|
39 |
GCArguments::initialize();
|
55935
|
40 |
|
56581
|
41 |
assert(UseEpsilonGC, "Sanity");
|
55935
|
42 |
|
|
43 |
// Forcefully exit when OOME is detected. Nothing we can do at that point.
|
|
44 |
if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) {
|
|
45 |
FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true);
|
|
46 |
}
|
|
47 |
|
|
48 |
if (EpsilonMaxTLABSize < MinTLABSize) {
|
|
49 |
warning("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);
|
|
50 |
EpsilonMaxTLABSize = MinTLABSize;
|
|
51 |
}
|
56577
|
52 |
|
|
53 |
if (!EpsilonElasticTLAB && EpsilonElasticTLABDecay) {
|
|
54 |
warning("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled");
|
|
55 |
FLAG_SET_DEFAULT(EpsilonElasticTLABDecay, false);
|
|
56 |
}
|
56495
|
57 |
|
|
58 |
#ifdef COMPILER2
|
|
59 |
// Enable loop strip mining: there are still non-GC safepoints, no need to make it worse
|
|
60 |
if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
|
|
61 |
FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
|
|
62 |
if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
|
|
63 |
FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
|
|
64 |
}
|
|
65 |
}
|
|
66 |
#endif
|
55935
|
67 |
}
|
|
68 |
|
|
69 |
CollectedHeap* EpsilonArguments::create_heap() {
|
55939
|
70 |
return create_heap_with_policy<EpsilonHeap, EpsilonCollectorPolicy>();
|
55935
|
71 |
}
|