author | shade |
Thu, 18 Jan 2018 12:08:41 +0100 | |
branch | epsilon-gc-branch |
changeset 56022 | dd005db4ec5c |
parent 55939 | c5c3e1a5c3f0 |
child 56028 | 267a6ce379ba |
permissions | -rw-r--r-- |
55935 | 1 |
/* |
2 |
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. |
|
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 |
||
38 |
void EpsilonArguments::initialize_flags() { |
|
39 |
GCArguments::initialize_flags(); |
|
40 |
||
56022
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
41 |
assert(UseEpsilonGC || UseNoGC, "Error"); |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
42 |
|
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
43 |
// UseNoGC is the alias, drop and replace it with the a single option: |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
44 |
// the rest of the code can use UseEpsilonGC then. |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
45 |
if (UseNoGC) { |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
46 |
FLAG_SET_DEFAULT(UseEpsilonGC, true); |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
47 |
FLAG_SET_DEFAULT(UseNoGC, false); |
dd005db4ec5c
Support -XX:+UseNoGC as the alias for -XX:+UseEpsilonGC
shade
parents:
55939
diff
changeset
|
48 |
} |
55935 | 49 |
|
50 |
// Forcefully exit when OOME is detected. Nothing we can do at that point. |
|
51 |
if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) { |
|
52 |
FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true); |
|
53 |
} |
|
54 |
||
55 |
#if INCLUDE_ALL_GCS |
|
56 |
if (EpsilonMaxTLABSize < MinTLABSize) { |
|
57 |
warning("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize); |
|
58 |
EpsilonMaxTLABSize = MinTLABSize; |
|
59 |
} |
|
60 |
#endif |
|
61 |
} |
|
62 |
||
63 |
CollectedHeap* EpsilonArguments::create_heap() { |
|
55939 | 64 |
return create_heap_with_policy<EpsilonHeap, EpsilonCollectorPolicy>(); |
55935 | 65 |
} |