Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/jcl/jcl_internal.h
5986 views
1
/*******************************************************************************
2
* Copyright (c) 2001, 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
/* Prototypes and types required by the JCL module */
23
24
#ifndef JCL_INTERNAL_H
25
#define JCL_INTERNAL_H
26
27
#ifdef __cplusplus
28
extern "C" {
29
#endif
30
31
/* ---------------- getstacktrace.c ---------------- */
32
j9object_t
33
createStackTraceThrowable(J9VMThread *currentThread, const UDATA *frames, UDATA maxFrames);
34
35
36
37
/* ---------------- mgmtthread.c ---------------- */
38
39
U_64
40
checkedTimeInterval(U_64 endNS, U_64 startNS);
41
42
43
/* ---------------- reflecthelp.c ---------------- */
44
void
45
initializeReflection(J9JavaVM *javaVM);
46
47
void
48
preloadReflectWrapperClasses(J9JavaVM *javaVM);
49
50
j9object_t getClassAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass);
51
52
jbyteArray getClassTypeAnnotationsAsByteArray(JNIEnv *env, jclass jlClass);
53
54
j9object_t getFieldAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass, J9JNIFieldID *j9FieldID);
55
56
jbyteArray getFieldTypeAnnotationsAsByteArray(JNIEnv *env, jobject jlrField);
57
58
j9object_t getMethodAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass, J9Method *ramMethod);
59
60
j9object_t getMethodParametersAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass, J9Method *ramMethod);
61
62
j9object_t getMethodTypeAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass, J9Method *ramMethod);
63
64
jbyteArray getMethodTypeAnnotationsAsByteArray(JNIEnv *env, jobject jlrMethod);
65
66
j9object_t getMethodDefaultAnnotationData(struct J9VMThread *vmThread, struct J9Class *declaringClass, J9Method *ramMethod);
67
68
jobjectArray getMethodParametersAsArray(JNIEnv *env, jobject jlrMethod);
69
70
/**
71
* The caller must have VM access.
72
* Build a java.lang.reflect.Field object for a field specified with a name and a declaring class.
73
* @param[in] vmThread The current vmThread.
74
* @param[in] declaringClass The declaring class. Must be non-null.
75
* @param[in] fieldName The name of the field.
76
* @return j9object_t a java.lang.reflect.Field
77
*/
78
j9object_t
79
getFieldObjHelper(J9VMThread *vmThread, jclass declaringClass, jstring fieldName);
80
81
/**
82
* Build a java.lang.reflect.Field for a specified declared field.
83
* @param[in] env The JNI context.
84
* @param[in] declaringClass The declaring class. Must be non-null.
85
* @param[in] fieldName The name of the field.
86
* @return jobject a java.lang.reflect.Field
87
*/
88
jobject
89
getDeclaredFieldHelper(JNIEnv *env, jobject declaringClass, jstring fieldName);
90
91
/**
92
* Build an array of java.lang.reflect.Field for the fields declared by a class.
93
* @param[in] env The JNI context.
94
* @param[in] declaringClass The declaring class. Must be non-null.
95
* @return jarray an array of java.lang.reflect.Field
96
*/
97
jarray
98
getDeclaredFieldsHelper(JNIEnv *env, jobject declaringClass);
99
100
/**
101
* Build a java.lang.reflect.Field for a specified field.
102
* @param[in] env The JNI context.
103
* @param[in] cls A class. Must be non-null.
104
* @param[in] fieldName The name of the field.
105
* @return jobject a java.lang.reflect.Field
106
*/
107
jobject
108
getFieldHelper(JNIEnv *env, jobject cls, jstring fieldName);
109
110
/**
111
* Build an array of java.lang.reflect.Field for the public fields of a class.
112
* @param[in] env The JNI context.
113
* @param[in] cls A class. Must be non-null.
114
* @return jarray an array of java.lang.reflect.Field
115
*/
116
jarray
117
getFieldsHelper(JNIEnv *env, jobject cls);
118
119
/**
120
* Get the array class for an element class.
121
* Creates the class if it isn't already created.
122
*
123
* @param[in] vmThread The current vmThread.
124
* @param[in] elementTypeClass The element class.
125
* @return the array class
126
*
127
* @pre has VM access
128
* @todo There is a duplicate copy of this function in j9vm/j7vmi.c
129
*/
130
J9Class *
131
fetchArrayClass(struct J9VMThread *vmThread, J9Class *elementTypeClass);
132
133
#if JAVA_SPEC_VERSION >= 14
134
/**
135
* Build an array of java.lang.reflect.RecordComponent for the record components of a record class
136
*
137
* @param[in] env The JNI context.
138
* @param[in] cls A class. Must be non-null.
139
*
140
* @return jarray an array of java.lang.reflect.RecordComponent.
141
* If cls is not a record, return null.
142
* If record class has no record components, return an empty array.
143
*/
144
jarray
145
getRecordComponentsHelper(JNIEnv *env, jobject cls);
146
#endif /* JAVA_SPEC_VERSION >= 14 */
147
148
/**
149
* Build an array of java.lang.String to return names of all permitted subclasses
150
* for a sealed class.
151
*
152
* @param[in] env The JNI context.
153
* @param[in] cls A class. Must be non-null.
154
*
155
* @return jarray an array of java.lang.String
156
*/
157
jarray
158
permittedSubclassesHelper(JNIEnv *env, jobject cls);
159
160
/* ---------------- sigquit.c ---------------- */
161
void
162
J9SigQuitShutdown(J9JavaVM * vm);
163
164
165
/* ---------------- unsafe_mem.c ---------------- */
166
UDATA
167
initializeUnsafeMemoryTracking(J9JavaVM* vm);
168
169
void
170
freeUnsafeMemory(J9JavaVM* vm);
171
172
/* ---------------- java_dyn_methodhandle.c ---------------- */
173
#if defined(J9VM_OPT_JAVA_OFFLOAD_SUPPORT)
174
void clearNonZAAPEligibleBit(JNIEnv *env, jclass nativeClass, const JNINativeMethod *nativeMethods, jint nativeMethodCount);
175
#endif /* J9VM_OPT_JAVA_OFFLOAD_SUPPORT */
176
177
#ifdef __cplusplus
178
}
179
#endif
180
181
#endif /* JCL_INTERNAL_H */
182
183