Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_include/j9modron.h
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2021 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#if !defined(J9MODRON_H__)
24
#define J9MODRON_H__
25
26
/* @ddr_namespace: map_to_type=J9ModronConstants */
27
28
#include "j9.h"
29
#include "j9consts.h"
30
#include "omrgcconsts.h"
31
32
#ifdef __cplusplus
33
extern "C" {
34
#endif /* __cplusplus */
35
36
/**
37
* Write barrier type definitions.
38
* @ingroup GC_Include
39
* @{
40
*/
41
typedef enum {
42
j9gc_modron_wrtbar_illegal = gc_modron_wrtbar_illegal,
43
j9gc_modron_wrtbar_none = gc_modron_wrtbar_none,
44
j9gc_modron_wrtbar_always = gc_modron_wrtbar_always,
45
j9gc_modron_wrtbar_oldcheck = gc_modron_wrtbar_oldcheck,
46
j9gc_modron_wrtbar_cardmark = gc_modron_wrtbar_cardmark,
47
j9gc_modron_wrtbar_cardmark_incremental = gc_modron_wrtbar_cardmark_incremental,
48
j9gc_modron_wrtbar_cardmark_and_oldcheck = gc_modron_wrtbar_cardmark_and_oldcheck,
49
j9gc_modron_wrtbar_satb = gc_modron_wrtbar_satb,
50
j9gc_modron_wrtbar_satb_and_oldcheck = gc_modron_wrtbar_satb_and_oldcheck,
51
j9gc_modron_wrtbar_count = gc_modron_wrtbar_count
52
} J9WriteBarrierType;
53
54
/**
55
* Read barrier type definitions.
56
* @ingroup GC_Include
57
* @{
58
*/
59
typedef enum {
60
j9gc_modron_readbar_illegal = gc_modron_readbar_illegal,
61
j9gc_modron_readbar_none = gc_modron_readbar_none,
62
j9gc_modron_readbar_always = gc_modron_readbar_always,
63
j9gc_modron_readbar_range_check = gc_modron_readbar_range_check,
64
j9gc_modron_readbar_region_check = gc_modron_readbar_region_check,
65
j9gc_modron_readbar_count = gc_modron_readbar_count
66
} J9ReadBarrierType;
67
68
typedef enum {
69
j9gc_modron_allocation_type_illegal = OMR_GC_ALLOCATION_TYPE_ILLEGAL,
70
j9gc_modron_allocation_type_tlh = OMR_GC_ALLOCATION_TYPE_TLH,
71
j9gc_modron_allocation_type_segregated = OMR_GC_ALLOCATION_TYPE_SEGREGATED,
72
j9gc_modron_allocation_type_count /* Total number of write barriers */
73
} J9GCAllocationType;
74
75
/**
76
* GC Feature type definitions (used by "j9gc_modron_isFeatureSupported")
77
*/
78
typedef enum {
79
j9gc_modron_feature_none = 0,
80
j9gc_modron_feature_inline_reference_get,
81
j9gc_modron_feature_count /* Total number of known features */
82
} J9GCFeatureType;
83
84
/**
85
* GC Configuration type definitions (used by "j9gc_modron_getConfigurationValueForKey")
86
*/
87
typedef enum {
88
j9gc_modron_configuration_none = 0,
89
j9gc_modron_configuration_heapAddressToCardAddressShift, /* a UDATA representing the shift amount to convert from heap granularity to card table granularity */
90
j9gc_modron_configuration_heapBaseForBarrierRange0_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->heapBaseForBarrierRange0 can change during the run (FALSE implies constant) */
91
j9gc_modron_configuration_activeCardTableBase_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->activeCardTableBase can change during the run (FALSE implies constant) */
92
j9gc_modron_configuration_heapSizeForBarrierRange0_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->heapSizeForBarrierRange0 can change during the run (FALSE implies constant) */
93
j9gc_modron_configuration_minimumObjectSize, /* a UDATA representing the minimum object size */
94
j9gc_modron_configuration_allocationType, /* a UDATA representing the allocation type see J9GCAllocationType enum for possible types */
95
j9gc_modron_configuration_discontiguousArraylets, /* a UDATA (TRUE or FALSE) representing whether or not discontiguousArraylets are enabled */
96
j9gc_modron_configuration_gcThreadCount, /* a UDATA representing the MAX number of GC threads being used */
97
j9gc_modron_configuration_objectAlignment, /* a UDATA representing the alignment of the object in heap */
98
j9gc_modron_configuration_compressObjectReferences, /* a UDATA (TRUE or FALSE) representing whether or not object references are compressed */
99
j9gc_modron_configuration_heapRegionShift, /* a UDATA representing the shift amount to convert an object pointer to the address of the region */
100
j9gc_modron_configuration_heapRegionStateTable, /* a pointer to the base of the region state table */
101
/* Add new values before this comment */
102
j9gc_modron_configuration_count /* Total number of known configuration keys */
103
} J9GCConfigurationKey;
104
105
106
/**
107
* Signature for the callback function passed to <code>MM_ReferenceChainWalker</code>
108
*/
109
typedef jvmtiIterationControl J9MODRON_REFERENCE_CHAIN_WALKER_CALLBACK(J9Object **slotPtr, J9Object *sourcePtr, void *userData, IDATA type, IDATA index, IDATA wasReportedBefore);
110
111
#define J9GC_ROOT_TYPE_UNKNOWN 1 /**< root that fell through a default state in an iterator, or called via non abstracted doSlot() */
112
#define J9GC_ROOT_TYPE_CLASS 2
113
#define J9GC_ROOT_TYPE_JNI_LOCAL 3
114
#define J9GC_ROOT_TYPE_JNI_GLOBAL 4
115
#define J9GC_ROOT_TYPE_JNI_WEAK_GLOBAL 5
116
#define J9GC_ROOT_TYPE_THREAD_SLOT 6
117
#define J9GC_ROOT_TYPE_MONITOR 7
118
#define J9GC_ROOT_TYPE_STRING_TABLE 8
119
#define J9GC_ROOT_TYPE_DEBUG_REFERENCE 9
120
#define J9GC_ROOT_TYPE_DEBUG_CLASS_REFERENCE 10
121
#define J9GC_ROOT_TYPE_FINALIZABLE_OBJECT 11
122
#define J9GC_ROOT_TYPE_UNFINALIZED_OBJECT 12
123
#define J9GC_ROOT_TYPE_WEAK_REFERENCE 13
124
#define J9GC_ROOT_TYPE_SOFT_REFERENCE 14
125
#define J9GC_ROOT_TYPE_PHANTOM_REFERENCE 15
126
#define J9GC_ROOT_TYPE_THREAD_MONITOR 16
127
#define J9GC_ROOT_TYPE_REMEMBERED_SET 17
128
#define J9GC_ROOT_TYPE_CLASSLOADER 18
129
#define J9GC_ROOT_TYPE_VM_CLASS_SLOT 19
130
#define J9GC_ROOT_TYPE_STACK_SLOT 20
131
#define J9GC_ROOT_TYPE_JVMTI_TAG_REF 21
132
#define J9GC_ROOT_TYPE_OWNABLE_SYNCHRONIZER_OBJECT 22
133
134
#define J9GC_REFERENCE_TYPE_UNKNOWN -1 /**< reference to an object that fell through a default state in an iterator */
135
#define J9GC_REFERENCE_TYPE_FIELD -2 /**< field reference to an object */
136
#define J9GC_REFERENCE_TYPE_STATIC -3 /**< static field reference to an object */
137
#define J9GC_REFERENCE_TYPE_CLASS -4 /**< reference to an object's class */
138
#define J9GC_REFERENCE_TYPE_ARRAY -5 /**< reference to an object from an array */
139
#define J9GC_REFERENCE_TYPE_WEAK_REFERENCE -6 /**< field reference to an object from a weak reference */
140
#define J9GC_REFERENCE_TYPE_CONSTANT_POOL -7 /**< reference to an object in a constant pool */
141
#define J9GC_REFERENCE_TYPE_PROTECTION_DOMAIN -8 /**< reference to a class' protection domain */
142
#define J9GC_REFERENCE_TYPE_SUPERCLASS -9 /**< reference to a class' superclass */
143
#define J9GC_REFERENCE_TYPE_INTERFACE -10 /**< reference to an interface implemented by a class */
144
#define J9GC_REFERENCE_TYPE_CLASSLOADER -11 /**< reference to the classloader of the class */
145
#define J9GC_REFERENCE_TYPE_CLASS_ARRAY_CLASS -12 /**< reference to an array class' component type class */
146
#define J9GC_REFERENCE_TYPE_CLASS_NAME_STRING -13 /**< reference to a class' name string */
147
#define J9GC_REFERENCE_TYPE_CALL_SITE -14 /**< call site reference to an object */
148
#define J9GC_REFERENCE_TYPE_CLASS_FCC -15 /**< reference to a class in flattened class cache */
149
150
/**
151
* #defines representing the results from j9gc_ext_check_is_valid_heap_object.
152
* @ingroup GC_Include
153
* @{
154
*/
155
#define J9OBJECTCHECK_OBJECT 0
156
#define J9OBJECTCHECK_CLASS 1
157
#define J9OBJECTCHECK_FORWARDED 2
158
#define J9OBJECTCHECK_INVALID 3
159
/**
160
* @}
161
*/
162
163
/**
164
* @ingroup GC_Include
165
* @name Class loader flags
166
* Borrowed from builder - should be made collector specific
167
* @{
168
*/
169
/* TODO Should these be deleted? or changed? */
170
#define J9_GC_CLASS_LOADER_SCANNED 0x1
171
#define J9_GC_CLASS_LOADER_DEAD 0x2
172
#define J9_GC_CLASS_LOADER_UNLOADING 0x4
173
#define J9_GC_CLASS_LOADER_ENQ_UNLOAD 0x8
174
#define J9_GC_CLASS_LOADER_REMEMBERED 0x10
175
176
/** @} */
177
178
/**
179
* @ingroup GC_Include
180
* @name Metronome CPU utilization component type flags.
181
* Any JVM component that hooks to GC events and consumes significant CPU cycles
182
* should be assigned a new component type so that GC can keep track of its utilization.
183
* @{
184
*/
185
#define J9_GC_METRONOME_UTILIZATION_COMPONENT_MUTATOR 0
186
#define J9_GC_METRONOME_UTILIZATION_COMPONENT_GC 1
187
#define J9_GC_METRONOME_UTILIZATION_COMPONENT_JIT 2
188
/** @} */
189
190
191
#define J9GC_HASH_SALT_COUNT_STANDARD 1
192
#define J9GC_HASH_SALT_NURSERY_INDEX 0
193
194
#define J9_GC_MANAGEMENT_POOL_JAVAHEAP 0x1
195
#define J9_GC_MANAGEMENT_POOL_TENURED 0x2
196
#define J9_GC_MANAGEMENT_POOL_TENURED_SOA 0x4
197
#define J9_GC_MANAGEMENT_POOL_TENURED_LOA 0x8
198
#define J9_GC_MANAGEMENT_POOL_NURSERY_ALLOCATE 0x10
199
#define J9_GC_MANAGEMENT_POOL_NURSERY_SURVIVOR 0x20
200
#define J9_GC_MANAGEMENT_POOL_REGION_OLD 0x40
201
#define J9_GC_MANAGEMENT_POOL_REGION_EDEN 0x80
202
#define J9_GC_MANAGEMENT_POOL_REGION_SURVIVOR 0x100
203
#define J9_GC_MANAGEMENT_POOL_REGION_RESERVED 0x200
204
#define J9_GC_MANAGEMENT_MAX_POOL 10
205
206
#define J9_GC_MANAGEMENT_COLLECTOR_SCAVENGE 0x1
207
#define J9_GC_MANAGEMENT_COLLECTOR_GLOBAL 0x2
208
#define J9_GC_MANAGEMENT_COLLECTOR_PGC 0x4
209
#define J9_GC_MANAGEMENT_COLLECTOR_GGC 0x8
210
#define J9_GC_MANAGEMENT_COLLECTOR_EPSILON 0x10
211
#define J9_GC_MANAGEMENT_MAX_COLLECTOR 5
212
213
#ifdef __cplusplus
214
} /* extern "C" { */
215
#endif /* __cplusplus */
216
217
#endif /* J9MODRON_H__ */
218
219
220