author | amurillo |
Fri, 19 Jun 2015 10:58:00 -0700 | |
changeset 33986 | 5cbe9cd17789 |
parent 33984 | 2333676816eb |
child 33994 | bf31c6908a70 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
28765
8878e8455f2a
8068730: Increase the precision of the implementation of java.time.Clock.systemUTC()
dfuchs
parents:
28246
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
#ifndef _JAVASOFT_JVM_H_ |
|
27 |
#define _JAVASOFT_JVM_H_ |
|
28 |
||
29 |
#include <sys/stat.h> |
|
30 |
||
31 |
#include "jni.h" |
|
32 |
#include "jvm_md.h" |
|
33 |
||
34 |
#ifdef __cplusplus |
|
35 |
extern "C" { |
|
36 |
#endif |
|
37 |
||
38 |
/* |
|
39 |
* This file contains additional functions exported from the VM. |
|
40 |
* These functions are complementary to the standard JNI support. |
|
41 |
* There are three parts to this file: |
|
42 |
* |
|
43 |
* First, this file contains the VM-related functions needed by native |
|
44 |
* libraries in the standard Java API. For example, the java.lang.Object |
|
45 |
* class needs VM-level functions that wait for and notify monitors. |
|
46 |
* |
|
47 |
* Second, this file contains the functions and constant definitions |
|
48 |
* needed by the byte code verifier and class file format checker. |
|
49 |
* These functions allow the verifier and format checker to be written |
|
50 |
* in a VM-independent way. |
|
51 |
* |
|
33984
2333676816eb
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30341
diff
changeset
|
52 |
* Third, this file contains various I/O and network operations needed |
2 | 53 |
* by the standard Java I/O and network APIs. |
54 |
*/ |
|
55 |
||
56 |
/* |
|
57 |
* Bump the version number when either of the following happens: |
|
58 |
* |
|
59 |
* 1. There is a change in JVM_* functions. |
|
60 |
* |
|
61 |
* 2. There is a change in the contract between VM and Java classes. |
|
62 |
* For example, if the VM relies on a new private field in Thread |
|
63 |
* class. |
|
64 |
*/ |
|
65 |
||
66 |
#define JVM_INTERFACE_VERSION 4 |
|
67 |
||
68 |
JNIEXPORT jint JNICALL |
|
69 |
JVM_GetInterfaceVersion(void); |
|
70 |
||
71 |
/************************************************************************* |
|
72 |
PART 1: Functions for Native Libraries |
|
73 |
************************************************************************/ |
|
74 |
/* |
|
75 |
* java.lang.Object |
|
76 |
*/ |
|
77 |
JNIEXPORT jint JNICALL |
|
78 |
JVM_IHashCode(JNIEnv *env, jobject obj); |
|
79 |
||
80 |
JNIEXPORT void JNICALL |
|
81 |
JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms); |
|
82 |
||
83 |
JNIEXPORT void JNICALL |
|
84 |
JVM_MonitorNotify(JNIEnv *env, jobject obj); |
|
85 |
||
86 |
JNIEXPORT void JNICALL |
|
87 |
JVM_MonitorNotifyAll(JNIEnv *env, jobject obj); |
|
88 |
||
89 |
JNIEXPORT jobject JNICALL |
|
90 |
JVM_Clone(JNIEnv *env, jobject obj); |
|
91 |
||
92 |
/* |
|
93 |
* java.lang.String |
|
94 |
*/ |
|
95 |
JNIEXPORT jstring JNICALL |
|
96 |
JVM_InternString(JNIEnv *env, jstring str); |
|
97 |
||
98 |
/* |
|
99 |
* java.lang.System |
|
100 |
*/ |
|
101 |
JNIEXPORT jlong JNICALL |
|
102 |
JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored); |
|
103 |
||
104 |
JNIEXPORT jlong JNICALL |
|
105 |
JVM_NanoTime(JNIEnv *env, jclass ignored); |
|
106 |
||
28765
8878e8455f2a
8068730: Increase the precision of the implementation of java.time.Clock.systemUTC()
dfuchs
parents:
28246
diff
changeset
|
107 |
JNIEXPORT jlong JNICALL |
8878e8455f2a
8068730: Increase the precision of the implementation of java.time.Clock.systemUTC()
dfuchs
parents:
28246
diff
changeset
|
108 |
JVM_GetNanoTimeAdjustment(JNIEnv *env, jclass ignored, jlong offset_secs); |
8878e8455f2a
8068730: Increase the precision of the implementation of java.time.Clock.systemUTC()
dfuchs
parents:
28246
diff
changeset
|
109 |
|
2 | 110 |
JNIEXPORT void JNICALL |
111 |
JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos, |
|
112 |
jobject dst, jint dst_pos, jint length); |
|
113 |
||
114 |
JNIEXPORT jobject JNICALL |
|
115 |
JVM_InitProperties(JNIEnv *env, jobject p); |
|
116 |
||
117 |
||
118 |
/* |
|
119 |
* java.lang.Runtime |
|
120 |
*/ |
|
121 |
JNIEXPORT void JNICALL |
|
122 |
JVM_Halt(jint code); |
|
123 |
||
124 |
JNIEXPORT void JNICALL |
|
125 |
JVM_GC(void); |
|
126 |
||
127 |
/* Returns the number of real-time milliseconds that have elapsed since the |
|
128 |
* least-recently-inspected heap object was last inspected by the garbage |
|
129 |
* collector. |
|
130 |
* |
|
131 |
* For simple stop-the-world collectors this value is just the time |
|
132 |
* since the most recent collection. For generational collectors it is the |
|
133 |
* time since the oldest generation was most recently collected. Other |
|
134 |
* collectors are free to return a pessimistic estimate of the elapsed time, or |
|
135 |
* simply the time since the last full collection was performed. |
|
136 |
* |
|
137 |
* Note that in the presence of reference objects, a given object that is no |
|
138 |
* longer strongly reachable may have to be inspected multiple times before it |
|
139 |
* can be reclaimed. |
|
140 |
*/ |
|
141 |
JNIEXPORT jlong JNICALL |
|
142 |
JVM_MaxObjectInspectionAge(void); |
|
143 |
||
144 |
JNIEXPORT jlong JNICALL |
|
145 |
JVM_TotalMemory(void); |
|
146 |
||
147 |
JNIEXPORT jlong JNICALL |
|
148 |
JVM_FreeMemory(void); |
|
149 |
||
150 |
JNIEXPORT jlong JNICALL |
|
151 |
JVM_MaxMemory(void); |
|
152 |
||
153 |
JNIEXPORT jint JNICALL |
|
154 |
JVM_ActiveProcessorCount(void); |
|
155 |
||
156 |
JNIEXPORT void * JNICALL |
|
157 |
JVM_LoadLibrary(const char *name); |
|
158 |
||
159 |
JNIEXPORT void JNICALL |
|
160 |
JVM_UnloadLibrary(void * handle); |
|
161 |
||
162 |
JNIEXPORT void * JNICALL |
|
163 |
JVM_FindLibraryEntry(void *handle, const char *name); |
|
164 |
||
165 |
JNIEXPORT jboolean JNICALL |
|
166 |
JVM_IsSupportedJNIVersion(jint version); |
|
167 |
||
168 |
/* |
|
169 |
* java.lang.Throwable |
|
170 |
*/ |
|
171 |
JNIEXPORT void JNICALL |
|
172 |
JVM_FillInStackTrace(JNIEnv *env, jobject throwable); |
|
173 |
||
174 |
JNIEXPORT jint JNICALL |
|
175 |
JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable); |
|
176 |
||
177 |
JNIEXPORT jobject JNICALL |
|
178 |
JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index); |
|
179 |
||
180 |
/* |
|
181 |
* java.lang.Thread |
|
182 |
*/ |
|
183 |
JNIEXPORT void JNICALL |
|
184 |
JVM_StartThread(JNIEnv *env, jobject thread); |
|
185 |
||
186 |
JNIEXPORT void JNICALL |
|
187 |
JVM_StopThread(JNIEnv *env, jobject thread, jobject exception); |
|
188 |
||
189 |
JNIEXPORT jboolean JNICALL |
|
190 |
JVM_IsThreadAlive(JNIEnv *env, jobject thread); |
|
191 |
||
192 |
JNIEXPORT void JNICALL |
|
193 |
JVM_SuspendThread(JNIEnv *env, jobject thread); |
|
194 |
||
195 |
JNIEXPORT void JNICALL |
|
196 |
JVM_ResumeThread(JNIEnv *env, jobject thread); |
|
197 |
||
198 |
JNIEXPORT void JNICALL |
|
199 |
JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio); |
|
200 |
||
201 |
JNIEXPORT void JNICALL |
|
202 |
JVM_Yield(JNIEnv *env, jclass threadClass); |
|
203 |
||
204 |
JNIEXPORT void JNICALL |
|
205 |
JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis); |
|
206 |
||
207 |
JNIEXPORT jobject JNICALL |
|
208 |
JVM_CurrentThread(JNIEnv *env, jclass threadClass); |
|
209 |
||
210 |
JNIEXPORT jint JNICALL |
|
211 |
JVM_CountStackFrames(JNIEnv *env, jobject thread); |
|
212 |
||
213 |
JNIEXPORT void JNICALL |
|
214 |
JVM_Interrupt(JNIEnv *env, jobject thread); |
|
215 |
||
216 |
JNIEXPORT jboolean JNICALL |
|
217 |
JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted); |
|
218 |
||
219 |
JNIEXPORT jboolean JNICALL |
|
220 |
JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj); |
|
221 |
||
222 |
JNIEXPORT void JNICALL |
|
223 |
JVM_DumpAllStacks(JNIEnv *env, jclass unused); |
|
224 |
||
225 |
JNIEXPORT jobjectArray JNICALL |
|
226 |
JVM_GetAllThreads(JNIEnv *env, jclass dummy); |
|
227 |
||
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10895
diff
changeset
|
228 |
JNIEXPORT void JNICALL |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10895
diff
changeset
|
229 |
JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name); |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
10895
diff
changeset
|
230 |
|
2 | 231 |
/* getStackTrace() and getAllStackTraces() method */ |
232 |
JNIEXPORT jobjectArray JNICALL |
|
233 |
JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads); |
|
234 |
||
235 |
/* |
|
236 |
* java.lang.SecurityManager |
|
237 |
*/ |
|
238 |
JNIEXPORT jclass JNICALL |
|
239 |
JVM_CurrentLoadedClass(JNIEnv *env); |
|
240 |
||
241 |
JNIEXPORT jobject JNICALL |
|
242 |
JVM_CurrentClassLoader(JNIEnv *env); |
|
243 |
||
244 |
JNIEXPORT jobjectArray JNICALL |
|
245 |
JVM_GetClassContext(JNIEnv *env); |
|
246 |
||
247 |
JNIEXPORT jint JNICALL |
|
248 |
JVM_ClassDepth(JNIEnv *env, jstring name); |
|
249 |
||
250 |
JNIEXPORT jint JNICALL |
|
251 |
JVM_ClassLoaderDepth(JNIEnv *env); |
|
252 |
||
253 |
/* |
|
254 |
* java.lang.Package |
|
255 |
*/ |
|
256 |
JNIEXPORT jstring JNICALL |
|
257 |
JVM_GetSystemPackage(JNIEnv *env, jstring name); |
|
258 |
||
259 |
JNIEXPORT jobjectArray JNICALL |
|
260 |
JVM_GetSystemPackages(JNIEnv *env); |
|
261 |
||
262 |
/* |
|
263 |
* java.io.ObjectInputStream |
|
264 |
*/ |
|
265 |
JNIEXPORT jobject JNICALL |
|
266 |
JVM_LatestUserDefinedLoader(JNIEnv *env); |
|
267 |
||
268 |
/* |
|
269 |
* java.lang.reflect.Array |
|
270 |
*/ |
|
271 |
JNIEXPORT jint JNICALL |
|
272 |
JVM_GetArrayLength(JNIEnv *env, jobject arr); |
|
273 |
||
274 |
JNIEXPORT jobject JNICALL |
|
275 |
JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index); |
|
276 |
||
277 |
JNIEXPORT jvalue JNICALL |
|
278 |
JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode); |
|
279 |
||
280 |
JNIEXPORT void JNICALL |
|
281 |
JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val); |
|
282 |
||
283 |
JNIEXPORT void JNICALL |
|
284 |
JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v, |
|
285 |
unsigned char vCode); |
|
286 |
||
287 |
JNIEXPORT jobject JNICALL |
|
288 |
JVM_NewArray(JNIEnv *env, jclass eltClass, jint length); |
|
289 |
||
290 |
JNIEXPORT jobject JNICALL |
|
291 |
JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); |
|
292 |
||
293 |
/* |
|
294 |
* java.lang.Class and java.lang.ClassLoader |
|
295 |
*/ |
|
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
296 |
|
21284
e6dfe841a88f
8025799: Restore sun.reflect.Reflection.getCallerClass(int) until a replacement API is provided
mchung
parents:
20482
diff
changeset
|
297 |
#define JVM_CALLER_DEPTH -1 |
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
298 |
|
2 | 299 |
/* |
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
300 |
* Returns the immediate caller class of the native method invoking |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
301 |
* JVM_GetCallerClass. The Method.invoke and other frames due to |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
302 |
* reflection machinery are skipped. |
2 | 303 |
* |
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
304 |
* The depth parameter must be -1 (JVM_DEPTH). The caller is expected |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
305 |
* to be marked with sun.reflect.CallerSensitive. The JVM will throw |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
306 |
* an error if it is not marked propertly. |
2 | 307 |
*/ |
308 |
JNIEXPORT jclass JNICALL |
|
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
309 |
JVM_GetCallerClass(JNIEnv *env, int depth); |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
15670
diff
changeset
|
310 |
|
2 | 311 |
|
312 |
/* |
|
313 |
* Find primitive classes |
|
314 |
* utf: class name |
|
315 |
*/ |
|
316 |
JNIEXPORT jclass JNICALL |
|
317 |
JVM_FindPrimitiveClass(JNIEnv *env, const char *utf); |
|
318 |
||
319 |
||
320 |
/* |
|
3833
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
321 |
* Find a class from a boot class loader. Returns NULL if class not found. |
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
322 |
*/ |
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
323 |
JNIEXPORT jclass JNICALL |
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
324 |
JVM_FindClassFromBootLoader(JNIEnv *env, const char *name); |
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
325 |
|
b666ed188811
4917309: (cl) Reduce internal usage of ClassNotFoundExceptions during class-loading
mchung
parents:
1090
diff
changeset
|
326 |
/* |
27072 | 327 |
* Find a class from a given class loader. Throws ClassNotFoundException. |
328 |
* name: name of class |
|
329 |
* init: whether initialization is done |
|
330 |
* loader: class loader to look up the class. This may not be the same as the caller's |
|
331 |
* class loader. |
|
332 |
* caller: initiating class. The initiating class may be null when a security |
|
333 |
* manager is not installed. |
|
334 |
*/ |
|
335 |
JNIEXPORT jclass JNICALL |
|
336 |
JVM_FindClassFromCaller(JNIEnv *env, const char *name, jboolean init, |
|
337 |
jobject loader, jclass caller); |
|
338 |
||
339 |
/* |
|
2 | 340 |
* Find a class from a given class. |
341 |
*/ |
|
342 |
JNIEXPORT jclass JNICALL |
|
343 |
JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init, |
|
344 |
jclass from); |
|
345 |
||
346 |
/* Find a loaded class cached by the VM */ |
|
347 |
JNIEXPORT jclass JNICALL |
|
348 |
JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name); |
|
349 |
||
350 |
/* Define a class */ |
|
351 |
JNIEXPORT jclass JNICALL |
|
352 |
JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, |
|
353 |
jsize len, jobject pd); |
|
354 |
||
355 |
/* Define a class with a source (added in JDK1.5) */ |
|
356 |
JNIEXPORT jclass JNICALL |
|
357 |
JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader, |
|
358 |
const jbyte *buf, jsize len, jobject pd, |
|
359 |
const char *source); |
|
360 |
||
361 |
/* |
|
362 |
* Reflection support functions |
|
363 |
*/ |
|
364 |
||
365 |
JNIEXPORT jstring JNICALL |
|
366 |
JVM_GetClassName(JNIEnv *env, jclass cls); |
|
367 |
||
368 |
JNIEXPORT jobjectArray JNICALL |
|
369 |
JVM_GetClassInterfaces(JNIEnv *env, jclass cls); |
|
370 |
||
371 |
JNIEXPORT jboolean JNICALL |
|
372 |
JVM_IsInterface(JNIEnv *env, jclass cls); |
|
373 |
||
374 |
JNIEXPORT jobjectArray JNICALL |
|
375 |
JVM_GetClassSigners(JNIEnv *env, jclass cls); |
|
376 |
||
377 |
JNIEXPORT void JNICALL |
|
378 |
JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers); |
|
379 |
||
380 |
JNIEXPORT jobject JNICALL |
|
381 |
JVM_GetProtectionDomain(JNIEnv *env, jclass cls); |
|
382 |
||
383 |
JNIEXPORT jboolean JNICALL |
|
384 |
JVM_IsArrayClass(JNIEnv *env, jclass cls); |
|
385 |
||
386 |
JNIEXPORT jboolean JNICALL |
|
387 |
JVM_IsPrimitiveClass(JNIEnv *env, jclass cls); |
|
388 |
||
389 |
JNIEXPORT jint JNICALL |
|
390 |
JVM_GetClassModifiers(JNIEnv *env, jclass cls); |
|
391 |
||
392 |
JNIEXPORT jobjectArray JNICALL |
|
393 |
JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass); |
|
394 |
||
395 |
JNIEXPORT jclass JNICALL |
|
396 |
JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass); |
|
397 |
||
30341
a026e34714ed
8057919: Class.getSimpleName() should work for non-JLS compliant class names
vlivanov
parents:
28765
diff
changeset
|
398 |
JNIEXPORT jstring JNICALL |
a026e34714ed
8057919: Class.getSimpleName() should work for non-JLS compliant class names
vlivanov
parents:
28765
diff
changeset
|
399 |
JVM_GetSimpleBinaryName(JNIEnv *env, jclass ofClass); |
a026e34714ed
8057919: Class.getSimpleName() should work for non-JLS compliant class names
vlivanov
parents:
28765
diff
changeset
|
400 |
|
2 | 401 |
/* Generics support (JDK 1.5) */ |
402 |
JNIEXPORT jstring JNICALL |
|
403 |
JVM_GetClassSignature(JNIEnv *env, jclass cls); |
|
404 |
||
405 |
/* Annotations support (JDK 1.5) */ |
|
406 |
JNIEXPORT jbyteArray JNICALL |
|
407 |
JVM_GetClassAnnotations(JNIEnv *env, jclass cls); |
|
408 |
||
15510
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
409 |
/* Type use annotations support (JDK 1.8) */ |
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
410 |
|
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
411 |
JNIEXPORT jbyteArray JNICALL |
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
412 |
JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls); |
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
413 |
|
20482
6dc1f81f522c
8009719: core reflection should get type annotation data from the VM lazily
jfranck
parents:
18139
diff
changeset
|
414 |
JNIEXPORT jbyteArray JNICALL |
6dc1f81f522c
8009719: core reflection should get type annotation data from the VM lazily
jfranck
parents:
18139
diff
changeset
|
415 |
JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field); |
6dc1f81f522c
8009719: core reflection should get type annotation data from the VM lazily
jfranck
parents:
18139
diff
changeset
|
416 |
|
6dc1f81f522c
8009719: core reflection should get type annotation data from the VM lazily
jfranck
parents:
18139
diff
changeset
|
417 |
JNIEXPORT jbyteArray JNICALL |
6dc1f81f522c
8009719: core reflection should get type annotation data from the VM lazily
jfranck
parents:
18139
diff
changeset
|
418 |
JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method); |
15510
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
15313
diff
changeset
|
419 |
|
2 | 420 |
/* |
421 |
* New (JDK 1.4) reflection implementation |
|
422 |
*/ |
|
423 |
||
424 |
JNIEXPORT jobjectArray JNICALL |
|
425 |
JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly); |
|
426 |
||
427 |
JNIEXPORT jobjectArray JNICALL |
|
428 |
JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly); |
|
429 |
||
430 |
JNIEXPORT jobjectArray JNICALL |
|
431 |
JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly); |
|
432 |
||
433 |
/* Differs from JVM_GetClassModifiers in treatment of inner classes. |
|
434 |
This returns the access flags for the class as specified in the |
|
435 |
class file rather than searching the InnerClasses attribute (if |
|
436 |
present) to find the source-level access flags. Only the values of |
|
437 |
the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be |
|
438 |
valid. */ |
|
439 |
JNIEXPORT jint JNICALL |
|
440 |
JVM_GetClassAccessFlags(JNIEnv *env, jclass cls); |
|
441 |
||
442 |
/* The following two reflection routines are still needed due to startup time issues */ |
|
443 |
/* |
|
444 |
* java.lang.reflect.Method |
|
445 |
*/ |
|
446 |
JNIEXPORT jobject JNICALL |
|
447 |
JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); |
|
448 |
||
449 |
/* |
|
450 |
* java.lang.reflect.Constructor |
|
451 |
*/ |
|
452 |
JNIEXPORT jobject JNICALL |
|
453 |
JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); |
|
454 |
||
455 |
/* |
|
456 |
* Constant pool access; currently used to implement reflective access to annotations (JDK 1.5) |
|
457 |
*/ |
|
458 |
||
459 |
JNIEXPORT jobject JNICALL |
|
460 |
JVM_GetClassConstantPool(JNIEnv *env, jclass cls); |
|
461 |
||
462 |
JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize |
|
463 |
(JNIEnv *env, jobject unused, jobject jcpool); |
|
464 |
||
465 |
JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt |
|
466 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
467 |
||
468 |
JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded |
|
469 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
470 |
||
471 |
JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt |
|
472 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
473 |
||
474 |
JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded |
|
475 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
476 |
||
477 |
JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt |
|
478 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
479 |
||
480 |
JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded |
|
481 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
482 |
||
483 |
JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt |
|
484 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
485 |
||
486 |
JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt |
|
487 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
488 |
||
489 |
JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt |
|
490 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
491 |
||
492 |
JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt |
|
493 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
494 |
||
495 |
JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt |
|
496 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
497 |
||
498 |
JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt |
|
499 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
500 |
||
501 |
JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At |
|
502 |
(JNIEnv *env, jobject unused, jobject jcpool, jint index); |
|
503 |
||
504 |
/* |
|
15294
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
505 |
* Parameter reflection |
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
506 |
*/ |
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
507 |
|
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
508 |
JNIEXPORT jobjectArray JNICALL |
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
509 |
JVM_GetMethodParameters(JNIEnv *env, jobject method); |
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
510 |
|
df55735ea03c
8004729: Add java.lang.reflect.Parameter and related changes for parameter reflection
robm
parents:
14342
diff
changeset
|
511 |
/* |
2 | 512 |
* java.security.* |
513 |
*/ |
|
514 |
||
515 |
JNIEXPORT jobject JNICALL |
|
516 |
JVM_DoPrivileged(JNIEnv *env, jclass cls, |
|
517 |
jobject action, jobject context, jboolean wrapException); |
|
518 |
||
519 |
JNIEXPORT jobject JNICALL |
|
520 |
JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls); |
|
521 |
||
522 |
JNIEXPORT jobject JNICALL |
|
523 |
JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls); |
|
524 |
||
525 |
/* |
|
526 |
* Signal support, used to implement the shutdown sequence. Every VM must |
|
527 |
* support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts |
|
528 |
* (^C) and the latter for external termination (kill, system shutdown, etc.). |
|
529 |
* Other platform-dependent signal values may also be supported. |
|
530 |
*/ |
|
531 |
||
532 |
JNIEXPORT void * JNICALL |
|
533 |
JVM_RegisterSignal(jint sig, void *handler); |
|
534 |
||
535 |
JNIEXPORT jboolean JNICALL |
|
536 |
JVM_RaiseSignal(jint sig); |
|
537 |
||
538 |
JNIEXPORT jint JNICALL |
|
539 |
JVM_FindSignal(const char *name); |
|
540 |
||
541 |
/* |
|
542 |
* Retrieve the assertion directives for the specified class. |
|
543 |
*/ |
|
544 |
JNIEXPORT jboolean JNICALL |
|
545 |
JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls); |
|
546 |
||
547 |
/* |
|
548 |
* Retrieve the assertion directives from the VM. |
|
549 |
*/ |
|
550 |
JNIEXPORT jobject JNICALL |
|
551 |
JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused); |
|
552 |
||
553 |
/* |
|
12884
8ff7cb7b7dd0
7175413: Typo in comments of JVM_SupportsCX8 in jvm.h
chegar
parents:
12047
diff
changeset
|
554 |
* java.util.concurrent.atomic.AtomicLong |
2 | 555 |
*/ |
556 |
JNIEXPORT jboolean JNICALL |
|
557 |
JVM_SupportsCX8(void); |
|
558 |
||
406
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
559 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
560 |
* com.sun.dtrace.jsdt support |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
561 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
562 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
563 |
#define JVM_TRACING_DTRACE_VERSION 1 |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
564 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
565 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
566 |
* Structure to pass one probe description to JVM |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
567 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
568 |
typedef struct { |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
569 |
jmethodID method; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
570 |
jstring function; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
571 |
jstring name; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
572 |
void* reserved[4]; // for future use |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
573 |
} JVM_DTraceProbe; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
574 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
575 |
/** |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
576 |
* Encapsulates the stability ratings for a DTrace provider field |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
577 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
578 |
typedef struct { |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
579 |
jint nameStability; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
580 |
jint dataStability; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
581 |
jint dependencyClass; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
582 |
} JVM_DTraceInterfaceAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
583 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
584 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
585 |
* Structure to pass one provider description to JVM |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
586 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
587 |
typedef struct { |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
588 |
jstring name; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
589 |
JVM_DTraceProbe* probes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
590 |
jint probe_count; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
591 |
JVM_DTraceInterfaceAttributes providerAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
592 |
JVM_DTraceInterfaceAttributes moduleAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
593 |
JVM_DTraceInterfaceAttributes functionAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
594 |
JVM_DTraceInterfaceAttributes nameAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
595 |
JVM_DTraceInterfaceAttributes argsAttributes; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
596 |
void* reserved[4]; // for future use |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
597 |
} JVM_DTraceProvider; |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
598 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
599 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
600 |
* Get the version number the JVM was built with |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
601 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
602 |
JNIEXPORT jint JNICALL |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
603 |
JVM_DTraceGetVersion(JNIEnv* env); |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
604 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
605 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
606 |
* Register new probe with given signature, return global handle |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
607 |
* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
608 |
* The version passed in is the version that the library code was |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
609 |
* built with. |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
610 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
611 |
JNIEXPORT jlong JNICALL |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
612 |
JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name, |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
613 |
jint providers_count, JVM_DTraceProvider* providers); |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
614 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
615 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
616 |
* Check JSDT probe |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
617 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
618 |
JNIEXPORT jboolean JNICALL |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
619 |
JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method); |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
620 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
621 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
622 |
* Destroy custom DOF |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
623 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
624 |
JNIEXPORT void JNICALL |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
625 |
JVM_DTraceDispose(JNIEnv* env, jlong activation_handle); |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
626 |
|
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
627 |
/* |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
628 |
* Check to see if DTrace is supported by OS |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
629 |
*/ |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
630 |
JNIEXPORT jboolean JNICALL |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
631 |
JVM_DTraceIsSupported(JNIEnv* env); |
bde3a21bcab0
6690122: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
2
diff
changeset
|
632 |
|
2 | 633 |
/************************************************************************* |
634 |
PART 2: Support for the Verifier and Class File Format Checker |
|
635 |
************************************************************************/ |
|
636 |
/* |
|
637 |
* Return the class name in UTF format. The result is valid |
|
638 |
* until JVM_ReleaseUTf is called. |
|
639 |
* |
|
640 |
* The caller must treat the string as a constant and not modify it |
|
641 |
* in any way. |
|
642 |
*/ |
|
643 |
JNIEXPORT const char * JNICALL |
|
644 |
JVM_GetClassNameUTF(JNIEnv *env, jclass cb); |
|
645 |
||
646 |
/* |
|
647 |
* Returns the constant pool types in the buffer provided by "types." |
|
648 |
*/ |
|
649 |
JNIEXPORT void JNICALL |
|
650 |
JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types); |
|
651 |
||
652 |
/* |
|
653 |
* Returns the number of Constant Pool entries. |
|
654 |
*/ |
|
655 |
JNIEXPORT jint JNICALL |
|
656 |
JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb); |
|
657 |
||
658 |
/* |
|
659 |
* Returns the number of *declared* fields or methods. |
|
660 |
*/ |
|
661 |
JNIEXPORT jint JNICALL |
|
662 |
JVM_GetClassFieldsCount(JNIEnv *env, jclass cb); |
|
663 |
||
664 |
JNIEXPORT jint JNICALL |
|
665 |
JVM_GetClassMethodsCount(JNIEnv *env, jclass cb); |
|
666 |
||
667 |
/* |
|
668 |
* Returns the CP indexes of exceptions raised by a given method. |
|
669 |
* Places the result in the given buffer. |
|
670 |
* |
|
671 |
* The method is identified by method_index. |
|
672 |
*/ |
|
673 |
JNIEXPORT void JNICALL |
|
674 |
JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index, |
|
675 |
unsigned short *exceptions); |
|
676 |
/* |
|
677 |
* Returns the number of exceptions raised by a given method. |
|
678 |
* The method is identified by method_index. |
|
679 |
*/ |
|
680 |
JNIEXPORT jint JNICALL |
|
681 |
JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index); |
|
682 |
||
683 |
/* |
|
684 |
* Returns the byte code sequence of a given method. |
|
685 |
* Places the result in the given buffer. |
|
686 |
* |
|
687 |
* The method is identified by method_index. |
|
688 |
*/ |
|
689 |
JNIEXPORT void JNICALL |
|
690 |
JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index, |
|
691 |
unsigned char *code); |
|
692 |
||
693 |
/* |
|
694 |
* Returns the length of the byte code sequence of a given method. |
|
695 |
* The method is identified by method_index. |
|
696 |
*/ |
|
697 |
JNIEXPORT jint JNICALL |
|
698 |
JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index); |
|
699 |
||
700 |
/* |
|
701 |
* A structure used to a capture exception table entry in a Java method. |
|
702 |
*/ |
|
703 |
typedef struct { |
|
704 |
jint start_pc; |
|
705 |
jint end_pc; |
|
706 |
jint handler_pc; |
|
707 |
jint catchType; |
|
708 |
} JVM_ExceptionTableEntryType; |
|
709 |
||
710 |
/* |
|
711 |
* Returns the exception table entry at entry_index of a given method. |
|
712 |
* Places the result in the given buffer. |
|
713 |
* |
|
714 |
* The method is identified by method_index. |
|
715 |
*/ |
|
716 |
JNIEXPORT void JNICALL |
|
717 |
JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index, |
|
718 |
jint entry_index, |
|
719 |
JVM_ExceptionTableEntryType *entry); |
|
720 |
||
721 |
/* |
|
722 |
* Returns the length of the exception table of a given method. |
|
723 |
* The method is identified by method_index. |
|
724 |
*/ |
|
725 |
JNIEXPORT jint JNICALL |
|
726 |
JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index); |
|
727 |
||
728 |
/* |
|
729 |
* Returns the modifiers of a given field. |
|
730 |
* The field is identified by field_index. |
|
731 |
*/ |
|
732 |
JNIEXPORT jint JNICALL |
|
733 |
JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index); |
|
734 |
||
735 |
/* |
|
736 |
* Returns the modifiers of a given method. |
|
737 |
* The method is identified by method_index. |
|
738 |
*/ |
|
739 |
JNIEXPORT jint JNICALL |
|
740 |
JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index); |
|
741 |
||
742 |
/* |
|
743 |
* Returns the number of local variables of a given method. |
|
744 |
* The method is identified by method_index. |
|
745 |
*/ |
|
746 |
JNIEXPORT jint JNICALL |
|
747 |
JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index); |
|
748 |
||
749 |
/* |
|
750 |
* Returns the number of arguments (including this pointer) of a given method. |
|
751 |
* The method is identified by method_index. |
|
752 |
*/ |
|
753 |
JNIEXPORT jint JNICALL |
|
754 |
JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index); |
|
755 |
||
756 |
/* |
|
757 |
* Returns the maximum amount of stack (in words) used by a given method. |
|
758 |
* The method is identified by method_index. |
|
759 |
*/ |
|
760 |
JNIEXPORT jint JNICALL |
|
761 |
JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index); |
|
762 |
||
763 |
/* |
|
764 |
* Is a given method a constructor. |
|
765 |
* The method is identified by method_index. |
|
766 |
*/ |
|
767 |
JNIEXPORT jboolean JNICALL |
|
768 |
JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index); |
|
769 |
||
770 |
/* |
|
15670
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
771 |
* Is the given method generated by the VM. |
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
772 |
* The method is identified by method_index. |
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
773 |
*/ |
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
774 |
JNIEXPORT jboolean JNICALL |
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
775 |
JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index); |
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
776 |
|
eca7bd7651cf
8007888: jdk fix default method: VerifyError: Illegal use of nonvirtual
acorn
parents:
15660
diff
changeset
|
777 |
/* |
2 | 778 |
* Returns the name of a given method in UTF format. |
779 |
* The result remains valid until JVM_ReleaseUTF is called. |
|
780 |
* |
|
781 |
* The caller must treat the string as a constant and not modify it |
|
782 |
* in any way. |
|
783 |
*/ |
|
784 |
JNIEXPORT const char * JNICALL |
|
785 |
JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index); |
|
786 |
||
787 |
/* |
|
788 |
* Returns the signature of a given method in UTF format. |
|
789 |
* The result remains valid until JVM_ReleaseUTF is called. |
|
790 |
* |
|
791 |
* The caller must treat the string as a constant and not modify it |
|
792 |
* in any way. |
|
793 |
*/ |
|
794 |
JNIEXPORT const char * JNICALL |
|
795 |
JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index); |
|
796 |
||
797 |
/* |
|
21278 | 798 |
* Returns the name of the field referred to at a given constant pool |
2 | 799 |
* index. |
800 |
* |
|
801 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
802 |
* is called. |
|
803 |
* |
|
804 |
* The caller must treat the string as a constant and not modify it |
|
805 |
* in any way. |
|
806 |
*/ |
|
807 |
JNIEXPORT const char * JNICALL |
|
808 |
JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index); |
|
809 |
||
810 |
/* |
|
21278 | 811 |
* Returns the name of the method referred to at a given constant pool |
2 | 812 |
* index. |
813 |
* |
|
814 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
815 |
* is called. |
|
816 |
* |
|
817 |
* The caller must treat the string as a constant and not modify it |
|
818 |
* in any way. |
|
819 |
*/ |
|
820 |
JNIEXPORT const char * JNICALL |
|
821 |
JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index); |
|
822 |
||
823 |
/* |
|
21278 | 824 |
* Returns the signature of the method referred to at a given constant pool |
2 | 825 |
* index. |
826 |
* |
|
827 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
828 |
* is called. |
|
829 |
* |
|
830 |
* The caller must treat the string as a constant and not modify it |
|
831 |
* in any way. |
|
832 |
*/ |
|
833 |
JNIEXPORT const char * JNICALL |
|
834 |
JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index); |
|
835 |
||
836 |
/* |
|
21278 | 837 |
* Returns the signature of the field referred to at a given constant pool |
2 | 838 |
* index. |
839 |
* |
|
840 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
841 |
* is called. |
|
842 |
* |
|
843 |
* The caller must treat the string as a constant and not modify it |
|
844 |
* in any way. |
|
845 |
*/ |
|
846 |
JNIEXPORT const char * JNICALL |
|
847 |
JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index); |
|
848 |
||
849 |
/* |
|
21278 | 850 |
* Returns the class name referred to at a given constant pool index. |
2 | 851 |
* |
852 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
853 |
* is called. |
|
854 |
* |
|
855 |
* The caller must treat the string as a constant and not modify it |
|
856 |
* in any way. |
|
857 |
*/ |
|
858 |
JNIEXPORT const char * JNICALL |
|
859 |
JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index); |
|
860 |
||
861 |
/* |
|
21278 | 862 |
* Returns the class name referred to at a given constant pool index. |
2 | 863 |
* |
864 |
* The constant pool entry must refer to a CONSTANT_Fieldref. |
|
865 |
* |
|
866 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
867 |
* is called. |
|
868 |
* |
|
869 |
* The caller must treat the string as a constant and not modify it |
|
870 |
* in any way. |
|
871 |
*/ |
|
872 |
JNIEXPORT const char * JNICALL |
|
873 |
JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index); |
|
874 |
||
875 |
/* |
|
21278 | 876 |
* Returns the class name referred to at a given constant pool index. |
2 | 877 |
* |
878 |
* The constant pool entry must refer to CONSTANT_Methodref or |
|
879 |
* CONSTANT_InterfaceMethodref. |
|
880 |
* |
|
881 |
* The result is in UTF format and remains valid until JVM_ReleaseUTF |
|
882 |
* is called. |
|
883 |
* |
|
884 |
* The caller must treat the string as a constant and not modify it |
|
885 |
* in any way. |
|
886 |
*/ |
|
887 |
JNIEXPORT const char * JNICALL |
|
888 |
JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index); |
|
889 |
||
890 |
/* |
|
891 |
* Returns the modifiers of a field in calledClass. The field is |
|
892 |
* referred to in class cb at constant pool entry index. |
|
893 |
* |
|
894 |
* The caller must treat the string as a constant and not modify it |
|
895 |
* in any way. |
|
896 |
* |
|
897 |
* Returns -1 if the field does not exist in calledClass. |
|
898 |
*/ |
|
899 |
JNIEXPORT jint JNICALL |
|
900 |
JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); |
|
901 |
||
902 |
/* |
|
903 |
* Returns the modifiers of a method in calledClass. The method is |
|
904 |
* referred to in class cb at constant pool entry index. |
|
905 |
* |
|
906 |
* Returns -1 if the method does not exist in calledClass. |
|
907 |
*/ |
|
908 |
JNIEXPORT jint JNICALL |
|
909 |
JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); |
|
910 |
||
911 |
/* |
|
912 |
* Releases the UTF string obtained from the VM. |
|
913 |
*/ |
|
914 |
JNIEXPORT void JNICALL |
|
915 |
JVM_ReleaseUTF(const char *utf); |
|
916 |
||
917 |
/* |
|
918 |
* Compare if two classes are in the same package. |
|
919 |
*/ |
|
920 |
JNIEXPORT jboolean JNICALL |
|
921 |
JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2); |
|
922 |
||
1090
c5805b1672a6
6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents:
715
diff
changeset
|
923 |
/* Get classfile constants */ |
c5805b1672a6
6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents:
715
diff
changeset
|
924 |
#include "classfile_constants.h" |
2 | 925 |
|
926 |
/* |
|
927 |
* A function defined by the byte-code verifier and called by the VM. |
|
928 |
* This is not a function implemented in the VM. |
|
929 |
* |
|
930 |
* Returns JNI_FALSE if verification fails. A detailed error message |
|
931 |
* will be places in msg_buf, whose length is specified by buf_len. |
|
932 |
*/ |
|
933 |
typedef jboolean (*verifier_fn_t)(JNIEnv *env, |
|
934 |
jclass cb, |
|
935 |
char * msg_buf, |
|
936 |
jint buf_len); |
|
937 |
||
938 |
||
939 |
/* |
|
940 |
* Support for a VM-independent class format checker. |
|
941 |
*/ |
|
942 |
typedef struct { |
|
943 |
unsigned long code; /* byte code */ |
|
944 |
unsigned long excs; /* exceptions */ |
|
945 |
unsigned long etab; /* catch table */ |
|
946 |
unsigned long lnum; /* line number */ |
|
947 |
unsigned long lvar; /* local vars */ |
|
948 |
} method_size_info; |
|
949 |
||
950 |
typedef struct { |
|
951 |
unsigned int constants; /* constant pool */ |
|
952 |
unsigned int fields; |
|
953 |
unsigned int methods; |
|
954 |
unsigned int interfaces; |
|
955 |
unsigned int fields2; /* number of static 2-word fields */ |
|
956 |
unsigned int innerclasses; /* # of records in InnerClasses attr */ |
|
957 |
||
958 |
method_size_info clinit; /* memory used in clinit */ |
|
959 |
method_size_info main; /* used everywhere else */ |
|
960 |
} class_size_info; |
|
961 |
||
962 |
/* |
|
963 |
* Functions defined in libjava.so to perform string conversions. |
|
964 |
* |
|
965 |
*/ |
|
966 |
||
967 |
typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str); |
|
968 |
||
969 |
typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b); |
|
970 |
||
971 |
/* This is the function defined in libjava.so that performs class |
|
972 |
* format checks. This functions fills in size information about |
|
973 |
* the class file and returns: |
|
974 |
* |
|
975 |
* 0: good |
|
976 |
* -1: out of memory |
|
977 |
* -2: bad format |
|
978 |
* -3: unsupported version |
|
979 |
* -4: bad class name |
|
980 |
*/ |
|
981 |
||
982 |
typedef jint (*check_format_fn_t)(char *class_name, |
|
983 |
unsigned char *data, |
|
984 |
unsigned int data_size, |
|
985 |
class_size_info *class_size, |
|
986 |
char *message_buffer, |
|
987 |
jint buffer_length, |
|
988 |
jboolean measure_only, |
|
989 |
jboolean check_relaxed); |
|
990 |
||
991 |
#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \ |
|
992 |
JVM_ACC_FINAL | \ |
|
993 |
JVM_ACC_SUPER | \ |
|
994 |
JVM_ACC_INTERFACE | \ |
|
995 |
JVM_ACC_ABSTRACT | \ |
|
996 |
JVM_ACC_ANNOTATION | \ |
|
997 |
JVM_ACC_ENUM | \ |
|
998 |
JVM_ACC_SYNTHETIC) |
|
999 |
||
1000 |
#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \ |
|
1001 |
JVM_ACC_PRIVATE | \ |
|
1002 |
JVM_ACC_PROTECTED | \ |
|
1003 |
JVM_ACC_STATIC | \ |
|
1004 |
JVM_ACC_FINAL | \ |
|
1005 |
JVM_ACC_VOLATILE | \ |
|
1006 |
JVM_ACC_TRANSIENT | \ |
|
1007 |
JVM_ACC_ENUM | \ |
|
1008 |
JVM_ACC_SYNTHETIC) |
|
1009 |
||
1010 |
#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \ |
|
1011 |
JVM_ACC_PRIVATE | \ |
|
1012 |
JVM_ACC_PROTECTED | \ |
|
1013 |
JVM_ACC_STATIC | \ |
|
1014 |
JVM_ACC_FINAL | \ |
|
1015 |
JVM_ACC_SYNCHRONIZED | \ |
|
1016 |
JVM_ACC_BRIDGE | \ |
|
1017 |
JVM_ACC_VARARGS | \ |
|
1018 |
JVM_ACC_NATIVE | \ |
|
1019 |
JVM_ACC_ABSTRACT | \ |
|
1020 |
JVM_ACC_STRICT | \ |
|
1021 |
JVM_ACC_SYNTHETIC) |
|
1022 |
||
1023 |
/* |
|
1024 |
* This is the function defined in libjava.so to perform path |
|
1025 |
* canonicalization. VM call this function before opening jar files |
|
1026 |
* to load system classes. |
|
1027 |
* |
|
1028 |
*/ |
|
1029 |
||
1030 |
typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len); |
|
1031 |
||
1032 |
/************************************************************************* |
|
1033 |
PART 3: I/O and Network Support |
|
1034 |
************************************************************************/ |
|
1035 |
||
1036 |
/* |
|
1037 |
* Convert a pathname into native format. This function does syntactic |
|
1038 |
* cleanup, such as removing redundant separator characters. It modifies |
|
1039 |
* the given pathname string in place. |
|
1040 |
*/ |
|
1041 |
JNIEXPORT char * JNICALL |
|
1042 |
JVM_NativePath(char *); |
|
1043 |
||
1044 |
/* |
|
1045 |
* The standard printing functions supported by the Java VM. (Should they |
|
1046 |
* be renamed to JVM_* in the future? |
|
1047 |
*/ |
|
1048 |
||
1049 |
/* |
|
1050 |
* BE CAREFUL! The following functions do not implement the |
|
1051 |
* full feature set of standard C printf formats. |
|
1052 |
*/ |
|
1053 |
int |
|
1054 |
jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); |
|
1055 |
||
1056 |
int |
|
1057 |
jio_snprintf(char *str, size_t count, const char *fmt, ...); |
|
1058 |
||
1059 |
int |
|
1060 |
jio_fprintf(FILE *, const char *fmt, ...); |
|
1061 |
||
1062 |
int |
|
1063 |
jio_vfprintf(FILE *, const char *fmt, va_list args); |
|
1064 |
||
1065 |
||
1066 |
JNIEXPORT void * JNICALL |
|
1067 |
JVM_RawMonitorCreate(void); |
|
1068 |
||
1069 |
JNIEXPORT void JNICALL |
|
1070 |
JVM_RawMonitorDestroy(void *mon); |
|
1071 |
||
1072 |
JNIEXPORT jint JNICALL |
|
1073 |
JVM_RawMonitorEnter(void *mon); |
|
1074 |
||
1075 |
JNIEXPORT void JNICALL |
|
1076 |
JVM_RawMonitorExit(void *mon); |
|
1077 |
||
1078 |
/* |
|
1079 |
* java.lang.management support |
|
1080 |
*/ |
|
1081 |
JNIEXPORT void* JNICALL |
|
1082 |
JVM_GetManagement(jint version); |
|
1083 |
||
1084 |
/* |
|
1085 |
* com.sun.tools.attach.VirtualMachine support |
|
1086 |
* |
|
1087 |
* Initialize the agent properties with the properties maintained in the VM. |
|
1088 |
*/ |
|
1089 |
JNIEXPORT jobject JNICALL |
|
1090 |
JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); |
|
1091 |
||
24268
43fb1c9e594c
8041979: sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms
sla
parents:
24120
diff
changeset
|
1092 |
JNIEXPORT jstring JNICALL |
43fb1c9e594c
8041979: sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms
sla
parents:
24120
diff
changeset
|
1093 |
JVM_GetTemporaryDirectory(JNIEnv *env); |
43fb1c9e594c
8041979: sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms
sla
parents:
24120
diff
changeset
|
1094 |
|
2 | 1095 |
/* Generics reflection support. |
1096 |
* |
|
1097 |
* Returns information about the given class's EnclosingMethod |
|
1098 |
* attribute, if present, or null if the class had no enclosing |
|
1099 |
* method. |
|
1100 |
* |
|
1101 |
* If non-null, the returned array contains three elements. Element 0 |
|
1102 |
* is the java.lang.Class of which the enclosing method is a member, |
|
1103 |
* and elements 1 and 2 are the java.lang.Strings for the enclosing |
|
1104 |
* method's name and descriptor, respectively. |
|
1105 |
*/ |
|
1106 |
JNIEXPORT jobjectArray JNICALL |
|
1107 |
JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass); |
|
1108 |
||
1109 |
/* ========================================================================= |
|
1110 |
* The following defines a private JVM interface that the JDK can query |
|
1111 |
* for the JVM version and capabilities. sun.misc.Version defines |
|
1112 |
* the methods for getting the VM version and its capabilities. |
|
1113 |
* |
|
1114 |
* When a new bit is added, the following should be updated to provide |
|
1115 |
* access to the new capability: |
|
1116 |
* HS: JVM_GetVersionInfo and Abstract_VM_Version class |
|
1117 |
* SDK: Version class |
|
1118 |
* |
|
1119 |
* Similary, a private JDK interface JDK_GetVersionInfo0 is defined for |
|
1120 |
* JVM to query for the JDK version and capabilities. |
|
1121 |
* |
|
1122 |
* When a new bit is added, the following should be updated to provide |
|
1123 |
* access to the new capability: |
|
1124 |
* HS: JDK_Version class |
|
1125 |
* SDK: JDK_GetVersionInfo0 |
|
1126 |
* |
|
1127 |
* ========================================================================== |
|
1128 |
*/ |
|
1129 |
typedef struct { |
|
33986
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1130 |
unsigned int jvm_version; /* Encoded $VNUM as specified by JEP-223 */ |
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1131 |
unsigned int patch_version : 8; /* JEP-223 patch version */ |
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1132 |
unsigned int reserved3 : 8; |
2 | 1133 |
unsigned int reserved1 : 16; |
1134 |
unsigned int reserved2; |
|
1135 |
||
1136 |
/* The following bits represents JVM supports that JDK has dependency on. |
|
1137 |
* JDK can use these bits to determine which JVM version |
|
1138 |
* and support it has to maintain runtime compatibility. |
|
1139 |
* |
|
1140 |
* When a new bit is added in a minor or update release, make sure |
|
1141 |
* the new bit is also added in the main/baseline. |
|
1142 |
*/ |
|
1143 |
unsigned int is_attach_supported : 1; |
|
15660
1649006b5598
8006691: Remove jvm_version_info->is_kernel_jvm field
zgu
parents:
15510
diff
changeset
|
1144 |
unsigned int : 31; |
2 | 1145 |
unsigned int : 32; |
1146 |
unsigned int : 32; |
|
1147 |
} jvm_version_info; |
|
1148 |
||
1149 |
#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) |
|
1150 |
#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) |
|
33984
2333676816eb
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30341
diff
changeset
|
1151 |
#define JVM_VERSION_SECURITY(version) ((version & 0x0000FF00) >> 8) |
2 | 1152 |
#define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) |
1153 |
||
1154 |
JNIEXPORT void JNICALL |
|
1155 |
JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); |
|
1156 |
||
1157 |
typedef struct { |
|
33986
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1158 |
unsigned int jdk_version; /* Encoded $VNUM as specified by JEP-223 */ |
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1159 |
unsigned int patch_version : 8; /* JEP-223 patch version */ |
5cbe9cd17789
8087202: Add support for PATCH field and remove unused fields of new version string
amurillo
parents:
33984
diff
changeset
|
1160 |
unsigned int reserved3 : 8; |
2 | 1161 |
unsigned int reserved1 : 16; |
1162 |
unsigned int reserved2; |
|
1163 |
||
1164 |
/* The following bits represents new JDK supports that VM has dependency on. |
|
1165 |
* VM implementation can use these bits to determine which JDK version |
|
1166 |
* and support it has to maintain runtime compatibility. |
|
1167 |
* |
|
1168 |
* When a new bit is added in a minor or update release, make sure |
|
1169 |
* the new bit is also added in the main/baseline. |
|
1170 |
*/ |
|
1171 |
unsigned int thread_park_blocker : 1; |
|
9286 | 1172 |
unsigned int post_vm_init_hook_enabled : 1; |
10895 | 1173 |
unsigned int pending_list_uses_discovered_field : 1; |
1174 |
unsigned int : 29; |
|
2 | 1175 |
unsigned int : 32; |
1176 |
unsigned int : 32; |
|
1177 |
} jdk_version_info; |
|
1178 |
||
1179 |
#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) |
|
1180 |
#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) |
|
33984
2333676816eb
8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
30341
diff
changeset
|
1181 |
#define JDK_VERSION_SECURITY(version) ((version & 0x0000FF00) >> 8) |
2 | 1182 |
#define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) |
1183 |
||
1184 |
/* |
|
1185 |
* This is the function JDK_GetVersionInfo0 defined in libjava.so |
|
1186 |
* that is dynamically looked up by JVM. |
|
1187 |
*/ |
|
1188 |
typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); |
|
1189 |
||
1190 |
/* |
|
1191 |
* This structure is used by the launcher to get the default thread |
|
1192 |
* stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a |
|
1193 |
* version of 1.1. As it is not supported otherwise, it has been removed |
|
1194 |
* from jni.h |
|
1195 |
*/ |
|
1196 |
typedef struct JDK1_1InitArgs { |
|
1197 |
jint version; |
|
1198 |
||
1199 |
char **properties; |
|
1200 |
jint checkSource; |
|
1201 |
jint nativeStackSize; |
|
1202 |
jint javaStackSize; |
|
1203 |
jint minHeapSize; |
|
1204 |
jint maxHeapSize; |
|
1205 |
jint verifyMode; |
|
1206 |
char *classpath; |
|
1207 |
||
1208 |
jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); |
|
1209 |
void (JNICALL *exit)(jint code); |
|
1210 |
void (JNICALL *abort)(void); |
|
1211 |
||
1212 |
jint enableClassGC; |
|
1213 |
jint enableVerboseGC; |
|
1214 |
jint disableAsyncGC; |
|
1215 |
jint verbose; |
|
1216 |
jboolean debugging; |
|
1217 |
jint debugPort; |
|
1218 |
} JDK1_1InitArgs; |
|
1219 |
||
1220 |
||
1221 |
#ifdef __cplusplus |
|
1222 |
} /* extern "C" */ |
|
1223 |
||
1224 |
#endif /* __cplusplus */ |
|
1225 |
||
1226 |
#endif /* !_JAVASOFT_JVM_H_ */ |