Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/runtime/globals_shared.hpp
40951 views
1
/*
2
* Copyright (c) 1997, 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
#ifndef SHARE_RUNTIME_GLOBALS_SHARED_HPP
26
#define SHARE_RUNTIME_GLOBALS_SHARED_HPP
27
28
#include "utilities/align.hpp"
29
#include "utilities/globalDefinitions.hpp"
30
#include "utilities/macros.hpp"
31
32
#include <float.h> // for DBL_MAX
33
34
// The larger HeapWordSize for 64bit requires larger heaps
35
// for the same application running in 64bit. See bug 4967770.
36
// The minimum alignment to a heap word size is done. Other
37
// parts of the memory system may require additional alignment
38
// and are responsible for those alignments.
39
#ifdef _LP64
40
#define ScaleForWordSize(x) align_down((x) * 13 / 10, HeapWordSize)
41
#else
42
#define ScaleForWordSize(x) (x)
43
#endif
44
45
// use this for flags that are true by default in the debug version but
46
// false in the optimized version, and vice versa
47
#ifdef ASSERT
48
#define trueInDebug true
49
#define falseInDebug false
50
#else
51
#define trueInDebug false
52
#define falseInDebug true
53
#endif
54
55
// use this for flags that are true per default in the product build
56
// but false in development builds, and vice versa
57
#ifdef PRODUCT
58
#define trueInProduct true
59
#define falseInProduct false
60
#else
61
#define trueInProduct false
62
#define falseInProduct true
63
#endif
64
65
// Only materialize src code for range checking when required, ignore otherwise
66
#define IGNORE_RANGE(a, b)
67
// Only materialize src code for contraint checking when required, ignore otherwise
68
#define IGNORE_CONSTRAINT(func,type)
69
70
#define IGNORE_FLAG(...)
71
72
#define DECLARE_PRODUCT_FLAG(type, name, value, ...) extern "C" type name;
73
#define DECLARE_PD_PRODUCT_FLAG(type, name, ...) extern "C" type name;
74
#ifdef PRODUCT
75
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) const type name = value;
76
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) const type name = pd_##name;
77
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) const type name = value;
78
#else
79
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) extern "C" type name;
80
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) extern "C" type name;
81
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) extern "C" type name;
82
#endif // PRODUCT
83
84
#define DECLARE_FLAGS(flag_group) \
85
flag_group(DECLARE_DEVELOPER_FLAG, \
86
DECLARE_PD_DEVELOPER_FLAG, \
87
DECLARE_PRODUCT_FLAG, \
88
DECLARE_PD_PRODUCT_FLAG, \
89
DECLARE_NOTPRODUCT_FLAG, \
90
IGNORE_RANGE, \
91
IGNORE_CONSTRAINT)
92
93
#define DECLARE_ARCH_FLAGS(flag_group) \
94
flag_group(DECLARE_DEVELOPER_FLAG, \
95
DECLARE_PRODUCT_FLAG, \
96
DECLARE_NOTPRODUCT_FLAG, \
97
IGNORE_RANGE, \
98
IGNORE_CONSTRAINT)
99
100
#endif // SHARE_RUNTIME_GLOBALS_SHARED_HPP
101
102