Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
41149 views
1
/*
2
* Copyright (c) 2015, 2021, 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/parallel/jvmFlagConstraintsParallel.hpp"
27
#include "gc/shared/gc_globals.hpp"
28
#include "runtime/globals.hpp"
29
#include "utilities/globalDefinitions.hpp"
30
31
JVMFlag::Error ParallelGCThreadsConstraintFuncParallel(uint value, bool verbose) {
32
// Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter.
33
// So can't exceed with "max_jint"
34
35
if (UseParallelGC && (value > (uint)max_jint)) {
36
JVMFlag::printError(verbose,
37
"ParallelGCThreads (" UINT32_FORMAT ") must be "
38
"less than or equal to " UINT32_FORMAT " for Parallel GC\n",
39
value, max_jint);
40
return JVMFlag::VIOLATES_CONSTRAINT;
41
}
42
return JVMFlag::SUCCESS;
43
}
44
45
JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) {
46
// InitialTenuringThreshold is only used for ParallelGC.
47
if (UseParallelGC && (value > MaxTenuringThreshold)) {
48
JVMFlag::printError(verbose,
49
"InitialTenuringThreshold (" UINTX_FORMAT ") must be "
50
"less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
51
value, MaxTenuringThreshold);
52
return JVMFlag::VIOLATES_CONSTRAINT;
53
}
54
return JVMFlag::SUCCESS;
55
}
56
57
JVMFlag::Error MaxTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) {
58
// As only ParallelGC uses InitialTenuringThreshold,
59
// we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold.
60
if (UseParallelGC && (value < InitialTenuringThreshold)) {
61
JVMFlag::printError(verbose,
62
"MaxTenuringThreshold (" UINTX_FORMAT ") must be "
63
"greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n",
64
value, InitialTenuringThreshold);
65
return JVMFlag::VIOLATES_CONSTRAINT;
66
}
67
68
return JVMFlag::SUCCESS;
69
}
70
71