Mercurial > hg > truffle
annotate src/share/vm/prims/jvm.h @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | d8041d695d19 |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
0 | 1 /* |
7624
b14da2e6f2dc
7174978: NPG: Fix bactrace builder for class redefinition
coleenp
parents:
7462
diff
changeset
|
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
982
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
982
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
982
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_PRIMS_JVM_H |
26 #define SHARE_VM_PRIMS_JVM_H | |
27 | |
28 #include "prims/jni.h" | |
29 #ifdef TARGET_OS_FAMILY_linux | |
30 # include "jvm_linux.h" | |
31 #endif | |
32 #ifdef TARGET_OS_FAMILY_solaris | |
33 # include "jvm_solaris.h" | |
34 #endif | |
35 #ifdef TARGET_OS_FAMILY_windows | |
36 # include "jvm_windows.h" | |
37 #endif | |
14411 | 38 #ifdef TARGET_OS_FAMILY_aix |
39 # include "jvm_aix.h" | |
40 #endif | |
3960 | 41 #ifdef TARGET_OS_FAMILY_bsd |
42 # include "jvm_bsd.h" | |
43 #endif | |
1972 | 44 |
0 | 45 #ifndef _JAVASOFT_JVM_H_ |
46 #define _JAVASOFT_JVM_H_ | |
47 | |
48 // HotSpot integration note: | |
49 // | |
50 // This file and jvm.h used with the JDK are identical, | |
3895
19241ae0d839
7082263: Reflection::resolve_field/field_get/field_set are broken
never
parents:
2460
diff
changeset
|
51 // except for the three includes removed below |
0 | 52 |
53 // #include <sys/stat.h> | |
54 // #include "jni.h" | |
55 // #include "jvm_md.h" | |
56 | |
57 | |
58 #ifdef __cplusplus | |
59 extern "C" { | |
60 #endif | |
61 | |
62 /* | |
63 * This file contains additional functions exported from the VM. | |
64 * These functions are complementary to the standard JNI support. | |
65 * There are three parts to this file: | |
66 * | |
67 * First, this file contains the VM-related functions needed by native | |
68 * libraries in the standard Java API. For example, the java.lang.Object | |
69 * class needs VM-level functions that wait for and notify monitors. | |
70 * | |
71 * Second, this file contains the functions and constant definitions | |
72 * needed by the byte code verifier and class file format checker. | |
73 * These functions allow the verifier and format checker to be written | |
74 * in a VM-independent way. | |
75 * | |
76 * Third, this file contains various I/O and nerwork operations needed | |
77 * by the standard Java I/O and network APIs. | |
78 */ | |
79 | |
80 /* | |
81 * Bump the version number when either of the following happens: | |
82 * | |
83 * 1. There is a change in JVM_* functions. | |
84 * | |
85 * 2. There is a change in the contract between VM and Java classes. | |
86 * For example, if the VM relies on a new private field in Thread | |
87 * class. | |
88 */ | |
89 | |
90 #define JVM_INTERFACE_VERSION 4 | |
91 | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7457
diff
changeset
|
92 JNIEXPORT jobjectArray JNICALL |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7457
diff
changeset
|
93 JVM_GetMethodParameters(JNIEnv *env, jobject method); |
0 | 94 |
95 JNIEXPORT jint JNICALL | |
96 JVM_GetInterfaceVersion(void); | |
97 | |
98 /************************************************************************* | |
99 PART 1: Functions for Native Libraries | |
100 ************************************************************************/ | |
101 /* | |
102 * java.lang.Object | |
103 */ | |
104 JNIEXPORT jint JNICALL | |
105 JVM_IHashCode(JNIEnv *env, jobject obj); | |
106 | |
107 JNIEXPORT void JNICALL | |
108 JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms); | |
109 | |
110 JNIEXPORT void JNICALL | |
111 JVM_MonitorNotify(JNIEnv *env, jobject obj); | |
112 | |
113 JNIEXPORT void JNICALL | |
114 JVM_MonitorNotifyAll(JNIEnv *env, jobject obj); | |
115 | |
116 JNIEXPORT jobject JNICALL | |
117 JVM_Clone(JNIEnv *env, jobject obj); | |
118 | |
119 /* | |
120 * java.lang.String | |
121 */ | |
122 JNIEXPORT jstring JNICALL | |
123 JVM_InternString(JNIEnv *env, jstring str); | |
124 | |
125 /* | |
126 * java.lang.System | |
127 */ | |
128 JNIEXPORT jlong JNICALL | |
129 JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored); | |
130 | |
131 JNIEXPORT jlong JNICALL | |
132 JVM_NanoTime(JNIEnv *env, jclass ignored); | |
133 | |
134 JNIEXPORT void JNICALL | |
135 JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos, | |
136 jobject dst, jint dst_pos, jint length); | |
137 | |
138 JNIEXPORT jobject JNICALL | |
139 JVM_InitProperties(JNIEnv *env, jobject p); | |
140 | |
141 /* | |
142 * java.io.File | |
143 */ | |
144 JNIEXPORT void JNICALL | |
145 JVM_OnExit(void (*func)(void)); | |
146 | |
147 /* | |
148 * java.lang.Runtime | |
149 */ | |
150 JNIEXPORT void JNICALL | |
151 JVM_Exit(jint code); | |
152 | |
153 JNIEXPORT void JNICALL | |
154 JVM_Halt(jint code); | |
155 | |
156 JNIEXPORT void JNICALL | |
157 JVM_GC(void); | |
158 | |
159 /* Returns the number of real-time milliseconds that have elapsed since the | |
160 * least-recently-inspected heap object was last inspected by the garbage | |
161 * collector. | |
162 * | |
163 * For simple stop-the-world collectors this value is just the time | |
164 * since the most recent collection. For generational collectors it is the | |
165 * time since the oldest generation was most recently collected. Other | |
166 * collectors are free to return a pessimistic estimate of the elapsed time, or | |
167 * simply the time since the last full collection was performed. | |
168 * | |
169 * Note that in the presence of reference objects, a given object that is no | |
170 * longer strongly reachable may have to be inspected multiple times before it | |
171 * can be reclaimed. | |
172 */ | |
173 JNIEXPORT jlong JNICALL | |
174 JVM_MaxObjectInspectionAge(void); | |
175 | |
176 JNIEXPORT void JNICALL | |
177 JVM_TraceInstructions(jboolean on); | |
178 | |
179 JNIEXPORT void JNICALL | |
180 JVM_TraceMethodCalls(jboolean on); | |
181 | |
182 JNIEXPORT jlong JNICALL | |
183 JVM_TotalMemory(void); | |
184 | |
185 JNIEXPORT jlong JNICALL | |
186 JVM_FreeMemory(void); | |
187 | |
188 JNIEXPORT jlong JNICALL | |
189 JVM_MaxMemory(void); | |
190 | |
191 JNIEXPORT jint JNICALL | |
192 JVM_ActiveProcessorCount(void); | |
193 | |
194 JNIEXPORT void * JNICALL | |
195 JVM_LoadLibrary(const char *name); | |
196 | |
197 JNIEXPORT void JNICALL | |
198 JVM_UnloadLibrary(void * handle); | |
199 | |
200 JNIEXPORT void * JNICALL | |
201 JVM_FindLibraryEntry(void *handle, const char *name); | |
202 | |
203 JNIEXPORT jboolean JNICALL | |
204 JVM_IsSupportedJNIVersion(jint version); | |
205 | |
206 /* | |
207 * java.lang.Float and java.lang.Double | |
208 */ | |
209 JNIEXPORT jboolean JNICALL | |
210 JVM_IsNaN(jdouble d); | |
211 | |
212 /* | |
213 * java.lang.Throwable | |
214 */ | |
215 JNIEXPORT void JNICALL | |
216 JVM_FillInStackTrace(JNIEnv *env, jobject throwable); | |
217 | |
218 JNIEXPORT jint JNICALL | |
219 JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable); | |
220 | |
221 JNIEXPORT jobject JNICALL | |
222 JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index); | |
223 | |
224 /* | |
225 * java.lang.Compiler | |
226 */ | |
227 JNIEXPORT void JNICALL | |
228 JVM_InitializeCompiler (JNIEnv *env, jclass compCls); | |
229 | |
230 JNIEXPORT jboolean JNICALL | |
231 JVM_IsSilentCompiler(JNIEnv *env, jclass compCls); | |
232 | |
233 JNIEXPORT jboolean JNICALL | |
234 JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls); | |
235 | |
236 JNIEXPORT jboolean JNICALL | |
237 JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname); | |
238 | |
239 JNIEXPORT jobject JNICALL | |
240 JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg); | |
241 | |
242 JNIEXPORT void JNICALL | |
243 JVM_EnableCompiler(JNIEnv *env, jclass compCls); | |
244 | |
245 JNIEXPORT void JNICALL | |
246 JVM_DisableCompiler(JNIEnv *env, jclass compCls); | |
247 | |
248 /* | |
249 * java.lang.Thread | |
250 */ | |
251 JNIEXPORT void JNICALL | |
252 JVM_StartThread(JNIEnv *env, jobject thread); | |
253 | |
254 JNIEXPORT void JNICALL | |
255 JVM_StopThread(JNIEnv *env, jobject thread, jobject exception); | |
256 | |
257 JNIEXPORT jboolean JNICALL | |
258 JVM_IsThreadAlive(JNIEnv *env, jobject thread); | |
259 | |
260 JNIEXPORT void JNICALL | |
261 JVM_SuspendThread(JNIEnv *env, jobject thread); | |
262 | |
263 JNIEXPORT void JNICALL | |
264 JVM_ResumeThread(JNIEnv *env, jobject thread); | |
265 | |
266 JNIEXPORT void JNICALL | |
267 JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio); | |
268 | |
269 JNIEXPORT void JNICALL | |
270 JVM_Yield(JNIEnv *env, jclass threadClass); | |
271 | |
272 JNIEXPORT void JNICALL | |
273 JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis); | |
274 | |
275 JNIEXPORT jobject JNICALL | |
276 JVM_CurrentThread(JNIEnv *env, jclass threadClass); | |
277 | |
278 JNIEXPORT jint JNICALL | |
279 JVM_CountStackFrames(JNIEnv *env, jobject thread); | |
280 | |
281 JNIEXPORT void JNICALL | |
282 JVM_Interrupt(JNIEnv *env, jobject thread); | |
283 | |
284 JNIEXPORT jboolean JNICALL | |
285 JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted); | |
286 | |
287 JNIEXPORT jboolean JNICALL | |
288 JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj); | |
289 | |
290 JNIEXPORT void JNICALL | |
291 JVM_DumpAllStacks(JNIEnv *env, jclass unused); | |
292 | |
293 JNIEXPORT jobjectArray JNICALL | |
294 JVM_GetAllThreads(JNIEnv *env, jclass dummy); | |
295 | |
4006 | 296 JNIEXPORT void JNICALL |
297 JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name); | |
298 | |
0 | 299 /* getStackTrace() and getAllStackTraces() method */ |
300 JNIEXPORT jobjectArray JNICALL | |
301 JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads); | |
302 | |
303 /* | |
304 * java.lang.SecurityManager | |
305 */ | |
306 JNIEXPORT jclass JNICALL | |
307 JVM_CurrentLoadedClass(JNIEnv *env); | |
308 | |
309 JNIEXPORT jobject JNICALL | |
310 JVM_CurrentClassLoader(JNIEnv *env); | |
311 | |
312 JNIEXPORT jobjectArray JNICALL | |
313 JVM_GetClassContext(JNIEnv *env); | |
314 | |
315 JNIEXPORT jint JNICALL | |
316 JVM_ClassDepth(JNIEnv *env, jstring name); | |
317 | |
318 JNIEXPORT jint JNICALL | |
319 JVM_ClassLoaderDepth(JNIEnv *env); | |
320 | |
321 /* | |
322 * java.lang.Package | |
323 */ | |
324 JNIEXPORT jstring JNICALL | |
325 JVM_GetSystemPackage(JNIEnv *env, jstring name); | |
326 | |
327 JNIEXPORT jobjectArray JNICALL | |
328 JVM_GetSystemPackages(JNIEnv *env); | |
329 | |
330 /* | |
331 * java.io.ObjectInputStream | |
332 */ | |
333 JNIEXPORT jobject JNICALL | |
334 JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass, | |
335 jclass initClass); | |
336 | |
337 JNIEXPORT jobject JNICALL | |
338 JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass, | |
339 jint length); | |
340 | |
341 JNIEXPORT jobject JNICALL | |
342 JVM_LatestUserDefinedLoader(JNIEnv *env); | |
343 | |
344 /* | |
345 * This function has been deprecated and should not be considered | |
346 * part of the specified JVM interface. | |
347 */ | |
348 JNIEXPORT jclass JNICALL | |
349 JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass, | |
350 jstring currClassName); | |
351 | |
352 /* | |
353 * java.lang.reflect.Array | |
354 */ | |
355 JNIEXPORT jint JNICALL | |
356 JVM_GetArrayLength(JNIEnv *env, jobject arr); | |
357 | |
358 JNIEXPORT jobject JNICALL | |
359 JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index); | |
360 | |
361 JNIEXPORT jvalue JNICALL | |
362 JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode); | |
363 | |
364 JNIEXPORT void JNICALL | |
365 JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val); | |
366 | |
367 JNIEXPORT void JNICALL | |
368 JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v, | |
369 unsigned char vCode); | |
370 | |
371 JNIEXPORT jobject JNICALL | |
372 JVM_NewArray(JNIEnv *env, jclass eltClass, jint length); | |
373 | |
374 JNIEXPORT jobject JNICALL | |
375 JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); | |
376 | |
377 /* | |
378 * java.lang.Class and java.lang.ClassLoader | |
379 */ | |
12824
615d83933195
8026025: JVM_GetCallerClass allows Reflection.getCallerClass(int depth) to use
dholmes
parents:
11099
diff
changeset
|
380 |
615d83933195
8026025: JVM_GetCallerClass allows Reflection.getCallerClass(int depth) to use
dholmes
parents:
11099
diff
changeset
|
381 #define JVM_CALLER_DEPTH -1 |
615d83933195
8026025: JVM_GetCallerClass allows Reflection.getCallerClass(int depth) to use
dholmes
parents:
11099
diff
changeset
|
382 |
0 | 383 /* |
384 * Returns the class in which the code invoking the native method | |
385 * belongs. | |
386 * | |
387 * Note that in JDK 1.1, native methods did not create a frame. | |
388 * In 1.2, they do. Therefore native methods like Class.forName | |
389 * can no longer look at the current frame for the caller class. | |
390 */ | |
391 JNIEXPORT jclass JNICALL | |
392 JVM_GetCallerClass(JNIEnv *env, int n); | |
393 | |
394 /* | |
395 * Find primitive classes | |
396 * utf: class name | |
397 */ | |
398 JNIEXPORT jclass JNICALL | |
399 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf); | |
400 | |
401 /* | |
402 * Link the class | |
403 */ | |
404 JNIEXPORT void JNICALL | |
405 JVM_ResolveClass(JNIEnv *env, jclass cls); | |
406 | |
407 /* | |
408 * Find a class from a given class loader. Throw ClassNotFoundException | |
409 * or NoClassDefFoundError depending on the value of the last | |
410 * argument. | |
411 */ | |
412 JNIEXPORT jclass JNICALL | |
413 JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init, | |
414 jobject loader, jboolean throwError); | |
415 | |
416 /* | |
878
abe076e3636f
6864003: Modify JVM_FindClassFromBootLoader to return null if class not found
mchung
parents:
431
diff
changeset
|
417 * Find a class from a boot class loader. Returns NULL if class not found. |
226
d5ba4f8aa38a
6714758: hotspot: provide an entry point to the BootStrap Class loader[dholmes,acorn]
ksrini
parents:
116
diff
changeset
|
418 */ |
d5ba4f8aa38a
6714758: hotspot: provide an entry point to the BootStrap Class loader[dholmes,acorn]
ksrini
parents:
116
diff
changeset
|
419 JNIEXPORT jclass JNICALL |
878
abe076e3636f
6864003: Modify JVM_FindClassFromBootLoader to return null if class not found
mchung
parents:
431
diff
changeset
|
420 JVM_FindClassFromBootLoader(JNIEnv *env, const char *name); |
226
d5ba4f8aa38a
6714758: hotspot: provide an entry point to the BootStrap Class loader[dholmes,acorn]
ksrini
parents:
116
diff
changeset
|
421 |
d5ba4f8aa38a
6714758: hotspot: provide an entry point to the BootStrap Class loader[dholmes,acorn]
ksrini
parents:
116
diff
changeset
|
422 /* |
0 | 423 * Find a class from a given class. |
424 */ | |
425 JNIEXPORT jclass JNICALL | |
426 JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init, | |
427 jclass from); | |
428 | |
429 /* Find a loaded class cached by the VM */ | |
430 JNIEXPORT jclass JNICALL | |
431 JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name); | |
432 | |
433 /* Define a class */ | |
434 JNIEXPORT jclass JNICALL | |
435 JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, | |
436 jsize len, jobject pd); | |
437 | |
438 /* Define a class with a source (added in JDK1.5) */ | |
439 JNIEXPORT jclass JNICALL | |
440 JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader, | |
441 const jbyte *buf, jsize len, jobject pd, | |
442 const char *source); | |
443 | |
973
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
444 /* Define a class with a source with conditional verification (added HSX 14) |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
445 * -Xverify:all will verify anyway, -Xverify:none will not verify, |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
446 * -Xverify:remote (default) will obey this conditional |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
447 * i.e. true = should_verify_class |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
448 */ |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
449 JNIEXPORT jclass JNICALL |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
450 JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name, |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
451 jobject loader, const jbyte *buf, |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
452 jsize len, jobject pd, const char *source, |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
453 jboolean verify); |
ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
878
diff
changeset
|
454 |
0 | 455 /* |
456 * Reflection support functions | |
457 */ | |
458 | |
459 JNIEXPORT jstring JNICALL | |
460 JVM_GetClassName(JNIEnv *env, jclass cls); | |
461 | |
462 JNIEXPORT jobjectArray JNICALL | |
463 JVM_GetClassInterfaces(JNIEnv *env, jclass cls); | |
464 | |
465 JNIEXPORT jobject JNICALL | |
466 JVM_GetClassLoader(JNIEnv *env, jclass cls); | |
467 | |
468 JNIEXPORT jboolean JNICALL | |
469 JVM_IsInterface(JNIEnv *env, jclass cls); | |
470 | |
471 JNIEXPORT jobjectArray JNICALL | |
472 JVM_GetClassSigners(JNIEnv *env, jclass cls); | |
473 | |
474 JNIEXPORT void JNICALL | |
475 JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers); | |
476 | |
477 JNIEXPORT jobject JNICALL | |
478 JVM_GetProtectionDomain(JNIEnv *env, jclass cls); | |
479 | |
480 JNIEXPORT jboolean JNICALL | |
481 JVM_IsArrayClass(JNIEnv *env, jclass cls); | |
482 | |
11175
e636d62005c3
restored JVM_SetProtectionDomain so that Graal still works with libjava.so from JDK7 (which expects this function to be defined)
Doug Simon <doug.simon@oracle.com>
parents:
11099
diff
changeset
|
483 // Preserved in Graal repo so that linking against a JDK7 libjava.so works |
e636d62005c3
restored JVM_SetProtectionDomain so that Graal still works with libjava.so from JDK7 (which expects this function to be defined)
Doug Simon <doug.simon@oracle.com>
parents:
11099
diff
changeset
|
484 JNIEXPORT void JNICALL |
e636d62005c3
restored JVM_SetProtectionDomain so that Graal still works with libjava.so from JDK7 (which expects this function to be defined)
Doug Simon <doug.simon@oracle.com>
parents:
11099
diff
changeset
|
485 JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain); |
e636d62005c3
restored JVM_SetProtectionDomain so that Graal still works with libjava.so from JDK7 (which expects this function to be defined)
Doug Simon <doug.simon@oracle.com>
parents:
11099
diff
changeset
|
486 |
e636d62005c3
restored JVM_SetProtectionDomain so that Graal still works with libjava.so from JDK7 (which expects this function to be defined)
Doug Simon <doug.simon@oracle.com>
parents:
11099
diff
changeset
|
487 |
0 | 488 JNIEXPORT jboolean JNICALL |
489 JVM_IsPrimitiveClass(JNIEnv *env, jclass cls); | |
490 | |
491 JNIEXPORT jclass JNICALL | |
492 JVM_GetComponentType(JNIEnv *env, jclass cls); | |
493 | |
494 JNIEXPORT jint JNICALL | |
495 JVM_GetClassModifiers(JNIEnv *env, jclass cls); | |
496 | |
497 JNIEXPORT jobjectArray JNICALL | |
498 JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass); | |
499 | |
500 JNIEXPORT jclass JNICALL | |
501 JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass); | |
502 | |
503 /* Generics support (JDK 1.5) */ | |
504 JNIEXPORT jstring JNICALL | |
505 JVM_GetClassSignature(JNIEnv *env, jclass cls); | |
506 | |
507 /* Annotations support (JDK 1.5) */ | |
508 JNIEXPORT jbyteArray JNICALL | |
509 JVM_GetClassAnnotations(JNIEnv *env, jclass cls); | |
510 | |
511 /* Annotations support (JDK 1.6) */ | |
512 | |
513 // field is a handle to a java.lang.reflect.Field object | |
514 JNIEXPORT jbyteArray JNICALL | |
515 JVM_GetFieldAnnotations(JNIEnv *env, jobject field); | |
516 | |
517 // method is a handle to a java.lang.reflect.Method object | |
518 JNIEXPORT jbyteArray JNICALL | |
519 JVM_GetMethodAnnotations(JNIEnv *env, jobject method); | |
520 | |
521 // method is a handle to a java.lang.reflect.Method object | |
522 JNIEXPORT jbyteArray JNICALL | |
523 JVM_GetMethodDefaultAnnotationValue(JNIEnv *env, jobject method); | |
524 | |
525 // method is a handle to a java.lang.reflect.Method object | |
526 JNIEXPORT jbyteArray JNICALL | |
527 JVM_GetMethodParameterAnnotations(JNIEnv *env, jobject method); | |
528 | |
7457
35431a769282
8004823: Add VM support for type annotation reflection
stefank
parents:
6725
diff
changeset
|
529 /* Type use annotations support (JDK 1.8) */ |
35431a769282
8004823: Add VM support for type annotation reflection
stefank
parents:
6725
diff
changeset
|
530 |
35431a769282
8004823: Add VM support for type annotation reflection
stefank
parents:
6725
diff
changeset
|
531 JNIEXPORT jbyteArray JNICALL |
35431a769282
8004823: Add VM support for type annotation reflection
stefank
parents:
6725
diff
changeset
|
532 JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls); |
0 | 533 |
8818
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
534 // field is a handle to a java.lang.reflect.Field object |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
535 JNIEXPORT jbyteArray JNICALL |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
536 JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field); |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
537 |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
538 // method is a handle to a java.lang.reflect.Method object |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
539 JNIEXPORT jbyteArray JNICALL |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
540 JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method); |
1916ca1dec2f
8009382: Add JVM_Get{Field|Method}TypeAnnotations
rbackman
parents:
8028
diff
changeset
|
541 |
0 | 542 /* |
543 * New (JDK 1.4) reflection implementation | |
544 */ | |
545 | |
546 JNIEXPORT jobjectArray JNICALL | |
547 JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly); | |
548 | |
549 JNIEXPORT jobjectArray JNICALL | |
550 JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly); | |
551 | |
552 JNIEXPORT jobjectArray JNICALL | |
553 JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly); | |
554 | |
555 /* Differs from JVM_GetClassModifiers in treatment of inner classes. | |
556 This returns the access flags for the class as specified in the | |
557 class file rather than searching the InnerClasses attribute (if | |
558 present) to find the source-level access flags. Only the values of | |
559 the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be | |
560 valid. */ | |
561 JNIEXPORT jint JNICALL | |
562 JVM_GetClassAccessFlags(JNIEnv *env, jclass cls); | |
563 | |
564 /* | |
565 * Constant pool access; currently used to implement reflective access to annotations (JDK 1.5) | |
566 */ | |
567 | |
568 JNIEXPORT jobject JNICALL | |
569 JVM_GetClassConstantPool(JNIEnv *env, jclass cls); | |
570 | |
571 JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
572 (JNIEnv *env, jobject obj, jobject unused); |
0 | 573 |
574 JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
575 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 576 |
577 JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
578 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 579 |
580 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
581 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 582 |
583 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
584 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 585 |
586 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
587 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 588 |
589 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
590 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 591 |
592 JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
593 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 594 |
595 JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
596 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 597 |
598 JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
599 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 600 |
601 JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
602 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 603 |
604 JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
605 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 606 |
607 JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
608 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 609 |
610 JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6143
diff
changeset
|
611 (JNIEnv *env, jobject obj, jobject unused, jint index); |
0 | 612 |
613 /* | |
614 * java.security.* | |
615 */ | |
616 | |
617 JNIEXPORT jobject JNICALL | |
618 JVM_DoPrivileged(JNIEnv *env, jclass cls, | |
619 jobject action, jobject context, jboolean wrapException); | |
620 | |
621 JNIEXPORT jobject JNICALL | |
622 JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls); | |
623 | |
624 JNIEXPORT jobject JNICALL | |
625 JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls); | |
626 | |
627 /* | |
628 * Signal support, used to implement the shutdown sequence. Every VM must | |
629 * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts | |
630 * (^C) and the latter for external termination (kill, system shutdown, etc.). | |
631 * Other platform-dependent signal values may also be supported. | |
632 */ | |
633 | |
634 JNIEXPORT void * JNICALL | |
635 JVM_RegisterSignal(jint sig, void *handler); | |
636 | |
637 JNIEXPORT jboolean JNICALL | |
638 JVM_RaiseSignal(jint sig); | |
639 | |
640 JNIEXPORT jint JNICALL | |
641 JVM_FindSignal(const char *name); | |
642 | |
643 /* | |
644 * Retrieve the assertion directives for the specified class. | |
645 */ | |
646 JNIEXPORT jboolean JNICALL | |
647 JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls); | |
648 | |
649 /* | |
650 * Retrieve the assertion directives from the VM. | |
651 */ | |
652 JNIEXPORT jobject JNICALL | |
653 JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused); | |
654 | |
655 /* | |
6143 | 656 * java.util.concurrent.atomic.AtomicLong |
0 | 657 */ |
658 JNIEXPORT jboolean JNICALL | |
659 JVM_SupportsCX8(void); | |
660 | |
661 JNIEXPORT jboolean JNICALL | |
662 JVM_CX8Field(JNIEnv *env, jobject obj, jfieldID fldID, jlong oldVal, jlong newVal); | |
663 | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
664 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
665 * com.sun.dtrace.jsdt support |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
666 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
667 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
668 #define JVM_TRACING_DTRACE_VERSION 1 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
669 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
670 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
671 * Structure to pass one probe description to JVM. |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
672 * |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
673 * The VM will overwrite the definition of the referenced method with |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
674 * code that will fire the probe. |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
675 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
676 typedef struct { |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
677 jmethodID method; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
678 jstring function; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
679 jstring name; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
680 void* reserved[4]; // for future use |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
681 } JVM_DTraceProbe; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
682 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
683 /** |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
684 * Encapsulates the stability ratings for a DTrace provider field |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
685 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
686 typedef struct { |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
687 jint nameStability; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
688 jint dataStability; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
689 jint dependencyClass; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
690 } JVM_DTraceInterfaceAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
691 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
692 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
693 * Structure to pass one provider description to JVM |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
694 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
695 typedef struct { |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
696 jstring name; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
697 JVM_DTraceProbe* probes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
698 jint probe_count; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
699 JVM_DTraceInterfaceAttributes providerAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
700 JVM_DTraceInterfaceAttributes moduleAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
701 JVM_DTraceInterfaceAttributes functionAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
702 JVM_DTraceInterfaceAttributes nameAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
703 JVM_DTraceInterfaceAttributes argsAttributes; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
704 void* reserved[4]; // for future use |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
705 } JVM_DTraceProvider; |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
706 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
707 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
708 * Get the version number the JVM was built with |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
709 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
710 JNIEXPORT jint JNICALL |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
711 JVM_DTraceGetVersion(JNIEnv* env); |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
712 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
713 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
714 * Register new probe with given signature, return global handle |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
715 * |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
716 * The version passed in is the version that the library code was |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
717 * built with. |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
718 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
719 JNIEXPORT jlong JNICALL |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
720 JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name, |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
721 jint providers_count, JVM_DTraceProvider* providers); |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
722 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
723 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
724 * Check JSDT probe |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
725 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
726 JNIEXPORT jboolean JNICALL |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
727 JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method); |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
728 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
729 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
730 * Destroy custom DOF |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
731 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
732 JNIEXPORT void JNICALL |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
733 JVM_DTraceDispose(JNIEnv* env, jlong handle); |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
734 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
735 /* |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
736 * Check to see if DTrace is supported by OS |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
737 */ |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
738 JNIEXPORT jboolean JNICALL |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
739 JVM_DTraceIsSupported(JNIEnv* env); |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
0
diff
changeset
|
740 |
0 | 741 /************************************************************************* |
742 PART 2: Support for the Verifier and Class File Format Checker | |
743 ************************************************************************/ | |
744 /* | |
745 * Return the class name in UTF format. The result is valid | |
746 * until JVM_ReleaseUTf is called. | |
747 * | |
748 * The caller must treat the string as a constant and not modify it | |
749 * in any way. | |
750 */ | |
751 JNIEXPORT const char * JNICALL | |
752 JVM_GetClassNameUTF(JNIEnv *env, jclass cb); | |
753 | |
754 /* | |
755 * Returns the constant pool types in the buffer provided by "types." | |
756 */ | |
757 JNIEXPORT void JNICALL | |
758 JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types); | |
759 | |
760 /* | |
761 * Returns the number of Constant Pool entries. | |
762 */ | |
763 JNIEXPORT jint JNICALL | |
764 JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb); | |
765 | |
766 /* | |
767 * Returns the number of *declared* fields or methods. | |
768 */ | |
769 JNIEXPORT jint JNICALL | |
770 JVM_GetClassFieldsCount(JNIEnv *env, jclass cb); | |
771 | |
772 JNIEXPORT jint JNICALL | |
773 JVM_GetClassMethodsCount(JNIEnv *env, jclass cb); | |
774 | |
775 /* | |
776 * Returns the CP indexes of exceptions raised by a given method. | |
777 * Places the result in the given buffer. | |
778 * | |
779 * The method is identified by method_index. | |
780 */ | |
781 JNIEXPORT void JNICALL | |
782 JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index, | |
783 unsigned short *exceptions); | |
784 /* | |
785 * Returns the number of exceptions raised by a given method. | |
786 * The method is identified by method_index. | |
787 */ | |
788 JNIEXPORT jint JNICALL | |
789 JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index); | |
790 | |
791 /* | |
792 * Returns the byte code sequence of a given method. | |
793 * Places the result in the given buffer. | |
794 * | |
795 * The method is identified by method_index. | |
796 */ | |
797 JNIEXPORT void JNICALL | |
798 JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index, | |
799 unsigned char *code); | |
800 | |
801 /* | |
802 * Returns the length of the byte code sequence of a given method. | |
803 * The method is identified by method_index. | |
804 */ | |
805 JNIEXPORT jint JNICALL | |
806 JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index); | |
807 | |
808 /* | |
809 * A structure used to a capture exception table entry in a Java method. | |
810 */ | |
811 typedef struct { | |
812 jint start_pc; | |
813 jint end_pc; | |
814 jint handler_pc; | |
815 jint catchType; | |
816 } JVM_ExceptionTableEntryType; | |
817 | |
818 /* | |
819 * Returns the exception table entry at entry_index of a given method. | |
820 * Places the result in the given buffer. | |
821 * | |
822 * The method is identified by method_index. | |
823 */ | |
824 JNIEXPORT void JNICALL | |
825 JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index, | |
826 jint entry_index, | |
827 JVM_ExceptionTableEntryType *entry); | |
828 | |
829 /* | |
830 * Returns the length of the exception table of a given method. | |
831 * The method is identified by method_index. | |
832 */ | |
833 JNIEXPORT jint JNICALL | |
834 JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index); | |
835 | |
836 /* | |
837 * Returns the modifiers of a given field. | |
838 * The field is identified by field_index. | |
839 */ | |
840 JNIEXPORT jint JNICALL | |
841 JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index); | |
842 | |
843 /* | |
844 * Returns the modifiers of a given method. | |
845 * The method is identified by method_index. | |
846 */ | |
847 JNIEXPORT jint JNICALL | |
848 JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index); | |
849 | |
850 /* | |
851 * Returns the number of local variables of a given method. | |
852 * The method is identified by method_index. | |
853 */ | |
854 JNIEXPORT jint JNICALL | |
855 JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index); | |
856 | |
857 /* | |
858 * Returns the number of arguments (including this pointer) of a given method. | |
859 * The method is identified by method_index. | |
860 */ | |
861 JNIEXPORT jint JNICALL | |
862 JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index); | |
863 | |
864 /* | |
865 * Returns the maximum amount of stack (in words) used by a given method. | |
866 * The method is identified by method_index. | |
867 */ | |
868 JNIEXPORT jint JNICALL | |
869 JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index); | |
870 | |
871 /* | |
872 * Is a given method a constructor. | |
873 * The method is identified by method_index. | |
874 */ | |
875 JNIEXPORT jboolean JNICALL | |
876 JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index); | |
877 | |
878 /* | |
7958
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
879 * Is the given method generated by the VM. |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
880 * The method is identified by method_index. |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
881 */ |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
882 JNIEXPORT jboolean JNICALL |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
883 JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index); |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
884 |
815957d0203e
8004967: Default method cause VerifyError: Illegal use of nonvirtual
acorn
parents:
7624
diff
changeset
|
885 /* |
0 | 886 * Returns the name of a given method in UTF format. |
887 * The result remains valid until JVM_ReleaseUTF is called. | |
888 * | |
889 * The caller must treat the string as a constant and not modify it | |
890 * in any way. | |
891 */ | |
892 JNIEXPORT const char * JNICALL | |
893 JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index); | |
894 | |
895 /* | |
896 * Returns the signature of a given method in UTF format. | |
897 * The result remains valid until JVM_ReleaseUTF is called. | |
898 * | |
899 * The caller must treat the string as a constant and not modify it | |
900 * in any way. | |
901 */ | |
902 JNIEXPORT const char * JNICALL | |
903 JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index); | |
904 | |
905 /* | |
906 * Returns the name of the field refered to at a given constant pool | |
907 * index. | |
908 * | |
909 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
910 * is called. | |
911 * | |
912 * The caller must treat the string as a constant and not modify it | |
913 * in any way. | |
914 */ | |
915 JNIEXPORT const char * JNICALL | |
916 JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index); | |
917 | |
918 /* | |
919 * Returns the name of the method refered to at a given constant pool | |
920 * index. | |
921 * | |
922 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
923 * is called. | |
924 * | |
925 * The caller must treat the string as a constant and not modify it | |
926 * in any way. | |
927 */ | |
928 JNIEXPORT const char * JNICALL | |
929 JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index); | |
930 | |
931 /* | |
932 * Returns the signature of the method refered to at a given constant pool | |
933 * index. | |
934 * | |
935 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
936 * is called. | |
937 * | |
938 * The caller must treat the string as a constant and not modify it | |
939 * in any way. | |
940 */ | |
941 JNIEXPORT const char * JNICALL | |
942 JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index); | |
943 | |
944 /* | |
945 * Returns the signature of the field refered to at a given constant pool | |
946 * index. | |
947 * | |
948 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
949 * is called. | |
950 * | |
951 * The caller must treat the string as a constant and not modify it | |
952 * in any way. | |
953 */ | |
954 JNIEXPORT const char * JNICALL | |
955 JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index); | |
956 | |
957 /* | |
958 * Returns the class name refered to at a given constant pool index. | |
959 * | |
960 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
961 * is called. | |
962 * | |
963 * The caller must treat the string as a constant and not modify it | |
964 * in any way. | |
965 */ | |
966 JNIEXPORT const char * JNICALL | |
967 JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index); | |
968 | |
969 /* | |
970 * Returns the class name refered to at a given constant pool index. | |
971 * | |
972 * The constant pool entry must refer to a CONSTANT_Fieldref. | |
973 * | |
974 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
975 * is called. | |
976 * | |
977 * The caller must treat the string as a constant and not modify it | |
978 * in any way. | |
979 */ | |
980 JNIEXPORT const char * JNICALL | |
981 JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index); | |
982 | |
983 /* | |
984 * Returns the class name refered to at a given constant pool index. | |
985 * | |
986 * The constant pool entry must refer to CONSTANT_Methodref or | |
987 * CONSTANT_InterfaceMethodref. | |
988 * | |
989 * The result is in UTF format and remains valid until JVM_ReleaseUTF | |
990 * is called. | |
991 * | |
992 * The caller must treat the string as a constant and not modify it | |
993 * in any way. | |
994 */ | |
995 JNIEXPORT const char * JNICALL | |
996 JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index); | |
997 | |
998 /* | |
999 * Returns the modifiers of a field in calledClass. The field is | |
1000 * referred to in class cb at constant pool entry index. | |
1001 * | |
1002 * The caller must treat the string as a constant and not modify it | |
1003 * in any way. | |
1004 * | |
1005 * Returns -1 if the field does not exist in calledClass. | |
1006 */ | |
1007 JNIEXPORT jint JNICALL | |
1008 JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); | |
1009 | |
1010 /* | |
1011 * Returns the modifiers of a method in calledClass. The method is | |
1012 * referred to in class cb at constant pool entry index. | |
1013 * | |
1014 * Returns -1 if the method does not exist in calledClass. | |
1015 */ | |
1016 JNIEXPORT jint JNICALL | |
1017 JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass); | |
1018 | |
1019 /* | |
1020 * Releases the UTF string obtained from the VM. | |
1021 */ | |
1022 JNIEXPORT void JNICALL | |
1023 JVM_ReleaseUTF(const char *utf); | |
1024 | |
1025 /* | |
1026 * Compare if two classes are in the same package. | |
1027 */ | |
1028 JNIEXPORT jboolean JNICALL | |
1029 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2); | |
1030 | |
1031 /* Constants in class files */ | |
1032 | |
1033 #define JVM_ACC_PUBLIC 0x0001 /* visible to everyone */ | |
1034 #define JVM_ACC_PRIVATE 0x0002 /* visible only to the defining class */ | |
1035 #define JVM_ACC_PROTECTED 0x0004 /* visible to subclasses */ | |
1036 #define JVM_ACC_STATIC 0x0008 /* instance variable is static */ | |
1037 #define JVM_ACC_FINAL 0x0010 /* no further subclassing, overriding */ | |
1038 #define JVM_ACC_SYNCHRONIZED 0x0020 /* wrap method call in monitor lock */ | |
1039 #define JVM_ACC_SUPER 0x0020 /* funky handling of invokespecial */ | |
1040 #define JVM_ACC_VOLATILE 0x0040 /* can not cache in registers */ | |
1041 #define JVM_ACC_BRIDGE 0x0040 /* bridge method generated by compiler */ | |
1042 #define JVM_ACC_TRANSIENT 0x0080 /* not persistent */ | |
1043 #define JVM_ACC_VARARGS 0x0080 /* method declared with variable number of args */ | |
1044 #define JVM_ACC_NATIVE 0x0100 /* implemented in C */ | |
1045 #define JVM_ACC_INTERFACE 0x0200 /* class is an interface */ | |
1046 #define JVM_ACC_ABSTRACT 0x0400 /* no definition provided */ | |
1047 #define JVM_ACC_STRICT 0x0800 /* strict floating point */ | |
1048 #define JVM_ACC_SYNTHETIC 0x1000 /* compiler-generated class, method or field */ | |
1049 #define JVM_ACC_ANNOTATION 0x2000 /* annotation type */ | |
1050 #define JVM_ACC_ENUM 0x4000 /* field is declared as element of enum */ | |
1051 | |
1052 #define JVM_ACC_PUBLIC_BIT 0 | |
1053 #define JVM_ACC_PRIVATE_BIT 1 | |
1054 #define JVM_ACC_PROTECTED_BIT 2 | |
1055 #define JVM_ACC_STATIC_BIT 3 | |
1056 #define JVM_ACC_FINAL_BIT 4 | |
1057 #define JVM_ACC_SYNCHRONIZED_BIT 5 | |
1058 #define JVM_ACC_SUPER_BIT 5 | |
1059 #define JVM_ACC_VOLATILE_BIT 6 | |
1060 #define JVM_ACC_BRIDGE_BIT 6 | |
1061 #define JVM_ACC_TRANSIENT_BIT 7 | |
1062 #define JVM_ACC_VARARGS_BIT 7 | |
1063 #define JVM_ACC_NATIVE_BIT 8 | |
1064 #define JVM_ACC_INTERFACE_BIT 9 | |
1065 #define JVM_ACC_ABSTRACT_BIT 10 | |
1066 #define JVM_ACC_STRICT_BIT 11 | |
1067 #define JVM_ACC_SYNTHETIC_BIT 12 | |
1068 #define JVM_ACC_ANNOTATION_BIT 13 | |
1069 #define JVM_ACC_ENUM_BIT 14 | |
1070 | |
1071 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/utilities/ConstantTag.java | |
1072 enum { | |
1073 JVM_CONSTANT_Utf8 = 1, | |
1074 JVM_CONSTANT_Unicode, /* unused */ | |
1075 JVM_CONSTANT_Integer, | |
1076 JVM_CONSTANT_Float, | |
1077 JVM_CONSTANT_Long, | |
1078 JVM_CONSTANT_Double, | |
1079 JVM_CONSTANT_Class, | |
1080 JVM_CONSTANT_String, | |
1081 JVM_CONSTANT_Fieldref, | |
1082 JVM_CONSTANT_Methodref, | |
1083 JVM_CONSTANT_InterfaceMethodref, | |
1602 | 1084 JVM_CONSTANT_NameAndType, |
1085 JVM_CONSTANT_MethodHandle = 15, // JSR 292 | |
1660
083fde3b838e
6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents:
1602
diff
changeset
|
1086 JVM_CONSTANT_MethodType = 16, // JSR 292 |
2460 | 1087 //JVM_CONSTANT_(unused) = 17, // JSR 292 early drafts only |
2011
dad31fc330cd
7001379: bootstrap method data needs to be moved from constant pool to a classfile attribute
jrose
parents:
1972
diff
changeset
|
1088 JVM_CONSTANT_InvokeDynamic = 18, // JSR 292 |
dad31fc330cd
7001379: bootstrap method data needs to be moved from constant pool to a classfile attribute
jrose
parents:
1972
diff
changeset
|
1089 JVM_CONSTANT_ExternalMax = 18 // Last tag found in classfiles |
1602 | 1090 }; |
1091 | |
1092 /* JVM_CONSTANT_MethodHandle subtypes */ | |
1093 enum { | |
1094 JVM_REF_getField = 1, | |
1095 JVM_REF_getStatic = 2, | |
1096 JVM_REF_putField = 3, | |
1097 JVM_REF_putStatic = 4, | |
1098 JVM_REF_invokeVirtual = 5, | |
1099 JVM_REF_invokeStatic = 6, | |
1100 JVM_REF_invokeSpecial = 7, | |
1101 JVM_REF_newInvokeSpecial = 8, | |
1102 JVM_REF_invokeInterface = 9 | |
0 | 1103 }; |
1104 | |
1105 /* Used in the newarray instruction. */ | |
1106 | |
1107 #define JVM_T_BOOLEAN 4 | |
1108 #define JVM_T_CHAR 5 | |
1109 #define JVM_T_FLOAT 6 | |
1110 #define JVM_T_DOUBLE 7 | |
1111 #define JVM_T_BYTE 8 | |
1112 #define JVM_T_SHORT 9 | |
1113 #define JVM_T_INT 10 | |
1114 #define JVM_T_LONG 11 | |
1115 | |
1116 /* JVM method signatures */ | |
1117 | |
1118 #define JVM_SIGNATURE_ARRAY '[' | |
1119 #define JVM_SIGNATURE_BYTE 'B' | |
1120 #define JVM_SIGNATURE_CHAR 'C' | |
1121 #define JVM_SIGNATURE_CLASS 'L' | |
1122 #define JVM_SIGNATURE_ENDCLASS ';' | |
1123 #define JVM_SIGNATURE_ENUM 'E' | |
1124 #define JVM_SIGNATURE_FLOAT 'F' | |
1125 #define JVM_SIGNATURE_DOUBLE 'D' | |
1126 #define JVM_SIGNATURE_FUNC '(' | |
1127 #define JVM_SIGNATURE_ENDFUNC ')' | |
1128 #define JVM_SIGNATURE_INT 'I' | |
1129 #define JVM_SIGNATURE_LONG 'J' | |
1130 #define JVM_SIGNATURE_SHORT 'S' | |
1131 #define JVM_SIGNATURE_VOID 'V' | |
1132 #define JVM_SIGNATURE_BOOLEAN 'Z' | |
1133 | |
1134 /* | |
1135 * A function defined by the byte-code verifier and called by the VM. | |
1136 * This is not a function implemented in the VM. | |
1137 * | |
1138 * Returns JNI_FALSE if verification fails. A detailed error message | |
1139 * will be places in msg_buf, whose length is specified by buf_len. | |
1140 */ | |
1141 typedef jboolean (*verifier_fn_t)(JNIEnv *env, | |
1142 jclass cb, | |
1143 char * msg_buf, | |
1144 jint buf_len); | |
1145 | |
1146 | |
1147 /* | |
1148 * Support for a VM-independent class format checker. | |
1149 */ | |
1150 typedef struct { | |
1151 unsigned long code; /* byte code */ | |
1152 unsigned long excs; /* exceptions */ | |
1153 unsigned long etab; /* catch table */ | |
1154 unsigned long lnum; /* line number */ | |
1155 unsigned long lvar; /* local vars */ | |
1156 } method_size_info; | |
1157 | |
1158 typedef struct { | |
1159 unsigned int constants; /* constant pool */ | |
1160 unsigned int fields; | |
1161 unsigned int methods; | |
1162 unsigned int interfaces; | |
1163 unsigned int fields2; /* number of static 2-word fields */ | |
1164 unsigned int innerclasses; /* # of records in InnerClasses attr */ | |
1165 | |
1166 method_size_info clinit; /* memory used in clinit */ | |
1167 method_size_info main; /* used everywhere else */ | |
1168 } class_size_info; | |
1169 | |
1170 /* | |
1171 * Functions defined in libjava.so to perform string conversions. | |
1172 * | |
1173 */ | |
1174 | |
1175 typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str); | |
1176 | |
1177 typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b); | |
1178 | |
1179 /* This is the function defined in libjava.so that performs class | |
1180 * format checks. This functions fills in size information about | |
1181 * the class file and returns: | |
1182 * | |
1183 * 0: good | |
1184 * -1: out of memory | |
1185 * -2: bad format | |
1186 * -3: unsupported version | |
1187 * -4: bad class name | |
1188 */ | |
1189 | |
1190 typedef jint (*check_format_fn_t)(char *class_name, | |
1191 unsigned char *data, | |
1192 unsigned int data_size, | |
1193 class_size_info *class_size, | |
1194 char *message_buffer, | |
1195 jint buffer_length, | |
1196 jboolean measure_only, | |
1197 jboolean check_relaxed); | |
1198 | |
1199 #define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \ | |
1200 JVM_ACC_FINAL | \ | |
1201 JVM_ACC_SUPER | \ | |
1202 JVM_ACC_INTERFACE | \ | |
1203 JVM_ACC_ABSTRACT | \ | |
1204 JVM_ACC_ANNOTATION | \ | |
1205 JVM_ACC_ENUM | \ | |
1206 JVM_ACC_SYNTHETIC) | |
1207 | |
1208 #define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \ | |
1209 JVM_ACC_PRIVATE | \ | |
1210 JVM_ACC_PROTECTED | \ | |
1211 JVM_ACC_STATIC | \ | |
1212 JVM_ACC_FINAL | \ | |
1213 JVM_ACC_VOLATILE | \ | |
1214 JVM_ACC_TRANSIENT | \ | |
1215 JVM_ACC_ENUM | \ | |
1216 JVM_ACC_SYNTHETIC) | |
1217 | |
1218 #define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \ | |
1219 JVM_ACC_PRIVATE | \ | |
1220 JVM_ACC_PROTECTED | \ | |
1221 JVM_ACC_STATIC | \ | |
1222 JVM_ACC_FINAL | \ | |
1223 JVM_ACC_SYNCHRONIZED | \ | |
1224 JVM_ACC_BRIDGE | \ | |
1225 JVM_ACC_VARARGS | \ | |
1226 JVM_ACC_NATIVE | \ | |
1227 JVM_ACC_ABSTRACT | \ | |
1228 JVM_ACC_STRICT | \ | |
1229 JVM_ACC_SYNTHETIC) | |
1230 | |
1231 /* | |
1232 * This is the function defined in libjava.so to perform path | |
1233 * canonicalization. VM call this function before opening jar files | |
1234 * to load system classes. | |
1235 * | |
1236 */ | |
1237 | |
1238 typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len); | |
1239 | |
1240 /************************************************************************* | |
1241 PART 3: I/O and Network Support | |
1242 ************************************************************************/ | |
1243 | |
1244 /* Note that the JVM IO functions are expected to return JVM_IO_ERR | |
1245 * when there is any kind of error. The caller can then use the | |
1246 * platform specific support (e.g., errno) to get the detailed | |
1247 * error info. The JVM_GetLastErrorString procedure may also be used | |
1248 * to obtain a descriptive error string. | |
1249 */ | |
1250 #define JVM_IO_ERR (-1) | |
1251 | |
1252 /* For interruptible IO. Returning JVM_IO_INTR indicates that an IO | |
1253 * operation has been disrupted by Thread.interrupt. There are a | |
1254 * number of technical difficulties related to interruptible IO that | |
1255 * need to be solved. For example, most existing programs do not handle | |
1256 * InterruptedIOExceptions specially, they simply treat those as any | |
1257 * IOExceptions, which typically indicate fatal errors. | |
1258 * | |
1259 * There are also two modes of operation for interruptible IO. In the | |
1260 * resumption mode, an interrupted IO operation is guaranteed not to | |
1261 * have any side-effects, and can be restarted. In the termination mode, | |
1262 * an interrupted IO operation corrupts the underlying IO stream, so | |
1263 * that the only reasonable operation on an interrupted stream is to | |
1264 * close that stream. The resumption mode seems to be impossible to | |
1265 * implement on Win32 and Solaris. Implementing the termination mode is | |
1266 * easier, but it's not clear that's the right semantics. | |
1267 * | |
1268 * Interruptible IO is not supported on Win32.It can be enabled/disabled | |
1269 * using a compile-time flag on Solaris. Third-party JVM ports do not | |
1270 * need to implement interruptible IO. | |
1271 */ | |
1272 #define JVM_IO_INTR (-2) | |
1273 | |
1274 /* Write a string into the given buffer, in the platform's local encoding, | |
1275 * that describes the most recent system-level error to occur in this thread. | |
1276 * Return the length of the string or zero if no error occurred. | |
1277 */ | |
1278 JNIEXPORT jint JNICALL | |
1279 JVM_GetLastErrorString(char *buf, int len); | |
1280 | |
1281 /* | |
1282 * Convert a pathname into native format. This function does syntactic | |
1283 * cleanup, such as removing redundant separator characters. It modifies | |
1284 * the given pathname string in place. | |
1285 */ | |
1286 JNIEXPORT char * JNICALL | |
1287 JVM_NativePath(char *); | |
1288 | |
1289 /* | |
1290 * JVM I/O error codes | |
1291 */ | |
1292 #define JVM_EEXIST -100 | |
1293 | |
1294 /* | |
1295 * Open a file descriptor. This function returns a negative error code | |
1296 * on error, and a non-negative integer that is the file descriptor on | |
1297 * success. | |
1298 */ | |
1299 JNIEXPORT jint JNICALL | |
1300 JVM_Open(const char *fname, jint flags, jint mode); | |
1301 | |
1302 /* | |
1303 * Close a file descriptor. This function returns -1 on error, and 0 | |
1304 * on success. | |
1305 * | |
1306 * fd the file descriptor to close. | |
1307 */ | |
1308 JNIEXPORT jint JNICALL | |
1309 JVM_Close(jint fd); | |
1310 | |
1311 /* | |
1312 * Read data from a file decriptor into a char array. | |
1313 * | |
1314 * fd the file descriptor to read from. | |
1315 * buf the buffer where to put the read data. | |
1316 * nbytes the number of bytes to read. | |
1317 * | |
1318 * This function returns -1 on error, and 0 on success. | |
1319 */ | |
1320 JNIEXPORT jint JNICALL | |
1321 JVM_Read(jint fd, char *buf, jint nbytes); | |
1322 | |
1323 /* | |
1324 * Write data from a char array to a file decriptor. | |
1325 * | |
1326 * fd the file descriptor to read from. | |
1327 * buf the buffer from which to fetch the data. | |
1328 * nbytes the number of bytes to write. | |
1329 * | |
1330 * This function returns -1 on error, and 0 on success. | |
1331 */ | |
1332 JNIEXPORT jint JNICALL | |
1333 JVM_Write(jint fd, char *buf, jint nbytes); | |
1334 | |
1335 /* | |
1336 * Returns the number of bytes available for reading from a given file | |
1337 * descriptor | |
1338 */ | |
1339 JNIEXPORT jint JNICALL | |
1340 JVM_Available(jint fd, jlong *pbytes); | |
1341 | |
1342 /* | |
1343 * Move the file descriptor pointer from whence by offset. | |
1344 * | |
1345 * fd the file descriptor to move. | |
1346 * offset the number of bytes to move it by. | |
1347 * whence the start from where to move it. | |
1348 * | |
1349 * This function returns the resulting pointer location. | |
1350 */ | |
1351 JNIEXPORT jlong JNICALL | |
1352 JVM_Lseek(jint fd, jlong offset, jint whence); | |
1353 | |
1354 /* | |
1355 * Set the length of the file associated with the given descriptor to the given | |
1356 * length. If the new length is longer than the current length then the file | |
1357 * is extended; the contents of the extended portion are not defined. The | |
1358 * value of the file pointer is undefined after this procedure returns. | |
1359 */ | |
1360 JNIEXPORT jint JNICALL | |
1361 JVM_SetLength(jint fd, jlong length); | |
1362 | |
1363 /* | |
1364 * Synchronize the file descriptor's in memory state with that of the | |
1365 * physical device. Return of -1 is an error, 0 is OK. | |
1366 */ | |
1367 JNIEXPORT jint JNICALL | |
1368 JVM_Sync(jint fd); | |
1369 | |
1370 /* | |
1371 * Networking library support | |
1372 */ | |
1373 | |
1374 JNIEXPORT jint JNICALL | |
1375 JVM_InitializeSocketLibrary(void); | |
1376 | |
1377 struct sockaddr; | |
1378 | |
1379 JNIEXPORT jint JNICALL | |
1380 JVM_Socket(jint domain, jint type, jint protocol); | |
1381 | |
1382 JNIEXPORT jint JNICALL | |
1383 JVM_SocketClose(jint fd); | |
1384 | |
1385 JNIEXPORT jint JNICALL | |
1386 JVM_SocketShutdown(jint fd, jint howto); | |
1387 | |
1388 JNIEXPORT jint JNICALL | |
1389 JVM_Recv(jint fd, char *buf, jint nBytes, jint flags); | |
1390 | |
1391 JNIEXPORT jint JNICALL | |
1392 JVM_Send(jint fd, char *buf, jint nBytes, jint flags); | |
1393 | |
1394 JNIEXPORT jint JNICALL | |
1395 JVM_Timeout(int fd, long timeout); | |
1396 | |
1397 JNIEXPORT jint JNICALL | |
1398 JVM_Listen(jint fd, jint count); | |
1399 | |
1400 JNIEXPORT jint JNICALL | |
1401 JVM_Connect(jint fd, struct sockaddr *him, jint len); | |
1402 | |
1403 JNIEXPORT jint JNICALL | |
1404 JVM_Bind(jint fd, struct sockaddr *him, jint len); | |
1405 | |
1406 JNIEXPORT jint JNICALL | |
1407 JVM_Accept(jint fd, struct sockaddr *him, jint *len); | |
1408 | |
1409 JNIEXPORT jint JNICALL | |
1410 JVM_RecvFrom(jint fd, char *buf, int nBytes, | |
1411 int flags, struct sockaddr *from, int *fromlen); | |
1412 | |
1413 JNIEXPORT jint JNICALL | |
1414 JVM_SendTo(jint fd, char *buf, int len, | |
1415 int flags, struct sockaddr *to, int tolen); | |
1416 | |
1417 JNIEXPORT jint JNICALL | |
1418 JVM_SocketAvailable(jint fd, jint *result); | |
1419 | |
1420 | |
1421 JNIEXPORT jint JNICALL | |
1422 JVM_GetSockName(jint fd, struct sockaddr *him, int *len); | |
1423 | |
1424 JNIEXPORT jint JNICALL | |
1425 JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen); | |
1426 | |
1427 JNIEXPORT jint JNICALL | |
1428 JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen); | |
1429 | |
1430 JNIEXPORT int JNICALL | |
1431 JVM_GetHostName(char* name, int namelen); | |
1432 | |
1433 /* | |
1434 * The standard printing functions supported by the Java VM. (Should they | |
1435 * be renamed to JVM_* in the future? | |
1436 */ | |
1437 | |
1438 /* | |
1439 * BE CAREFUL! The following functions do not implement the | |
1440 * full feature set of standard C printf formats. | |
1441 */ | |
2191 | 1442 JNIEXPORT int |
0 | 1443 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); |
1444 | |
2191 | 1445 JNIEXPORT int |
0 | 1446 jio_snprintf(char *str, size_t count, const char *fmt, ...); |
1447 | |
2191 | 1448 JNIEXPORT int |
0 | 1449 jio_fprintf(FILE *, const char *fmt, ...); |
1450 | |
2191 | 1451 JNIEXPORT int |
0 | 1452 jio_vfprintf(FILE *, const char *fmt, va_list args); |
1453 | |
1454 | |
1455 JNIEXPORT void * JNICALL | |
1456 JVM_RawMonitorCreate(void); | |
1457 | |
1458 JNIEXPORT void JNICALL | |
1459 JVM_RawMonitorDestroy(void *mon); | |
1460 | |
1461 JNIEXPORT jint JNICALL | |
1462 JVM_RawMonitorEnter(void *mon); | |
1463 | |
1464 JNIEXPORT void JNICALL | |
1465 JVM_RawMonitorExit(void *mon); | |
1466 | |
1467 /* | |
1468 * java.lang.reflect.Method | |
1469 */ | |
1470 JNIEXPORT jobject JNICALL | |
1471 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); | |
1472 | |
1473 /* | |
1474 * java.lang.reflect.Constructor | |
1475 */ | |
1476 JNIEXPORT jobject JNICALL | |
1477 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); | |
1478 | |
1479 /* | |
1480 * java.lang.management support | |
1481 */ | |
1482 JNIEXPORT void* JNICALL | |
1483 JVM_GetManagement(jint version); | |
1484 | |
1485 /* | |
1486 * com.sun.tools.attach.VirtualMachine support | |
1487 * | |
1488 * Initialize the agent properties with the properties maintained in the VM. | |
1489 */ | |
1490 JNIEXPORT jobject JNICALL | |
1491 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); | |
1492 | |
1493 /* Generics reflection support. | |
1494 * | |
1495 * Returns information about the given class's EnclosingMethod | |
1496 * attribute, if present, or null if the class had no enclosing | |
1497 * method. | |
1498 * | |
1499 * If non-null, the returned array contains three elements. Element 0 | |
1500 * is the java.lang.Class of which the enclosing method is a member, | |
1501 * and elements 1 and 2 are the java.lang.Strings for the enclosing | |
1502 * method's name and descriptor, respectively. | |
1503 */ | |
1504 JNIEXPORT jobjectArray JNICALL | |
1505 JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass); | |
1506 | |
1507 /* | |
1508 * Java thread state support | |
1509 */ | |
1510 enum { | |
1511 JAVA_THREAD_STATE_NEW = 0, | |
1512 JAVA_THREAD_STATE_RUNNABLE = 1, | |
1513 JAVA_THREAD_STATE_BLOCKED = 2, | |
1514 JAVA_THREAD_STATE_WAITING = 3, | |
1515 JAVA_THREAD_STATE_TIMED_WAITING = 4, | |
1516 JAVA_THREAD_STATE_TERMINATED = 5, | |
1517 JAVA_THREAD_STATE_COUNT = 6 | |
1518 }; | |
1519 | |
1520 /* | |
1521 * Returns an array of the threadStatus values representing the | |
1522 * given Java thread state. Returns NULL if the VM version is | |
1523 * incompatible with the JDK or doesn't support the given | |
1524 * Java thread state. | |
1525 */ | |
1526 JNIEXPORT jintArray JNICALL | |
1527 JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState); | |
1528 | |
1529 /* | |
1530 * Returns an array of the substate names representing the | |
1531 * given Java thread state. Returns NULL if the VM version is | |
1532 * incompatible with the JDK or the VM doesn't support | |
1533 * the given Java thread state. | |
1534 * values must be the jintArray returned from JVM_GetThreadStateValues | |
1535 * and javaThreadState. | |
1536 */ | |
1537 JNIEXPORT jobjectArray JNICALL | |
1538 JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values); | |
1539 | |
1540 /* ========================================================================= | |
1541 * The following defines a private JVM interface that the JDK can query | |
1542 * for the JVM version and capabilities. sun.misc.Version defines | |
1543 * the methods for getting the VM version and its capabilities. | |
1544 * | |
1545 * When a new bit is added, the following should be updated to provide | |
1546 * access to the new capability: | |
1547 * HS: JVM_GetVersionInfo and Abstract_VM_Version class | |
1548 * SDK: Version class | |
1549 * | |
1550 * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for | |
1551 * JVM to query for the JDK version and capabilities. | |
1552 * | |
1553 * When a new bit is added, the following should be updated to provide | |
1554 * access to the new capability: | |
1555 * HS: JDK_Version class | |
1556 * SDK: JDK_GetVersionInfo0 | |
1557 * | |
1558 * ========================================================================== | |
1559 */ | |
1560 typedef struct { | |
1561 /* HotSpot Express VM version string: | |
1562 * <major>.<minor>-bxx[-<identifier>][-<debug_flavor>] | |
1563 */ | |
1564 unsigned int jvm_version; /* Consists of major.minor.0.build */ | |
1565 unsigned int update_version : 8; /* 0 in HotSpot Express VM */ | |
1566 unsigned int special_update_version : 8; /* 0 in HotSpot Express VM */ | |
1567 unsigned int reserved1 : 16; | |
1568 unsigned int reserved2; | |
1569 | |
1570 /* The following bits represents JVM supports that JDK has dependency on. | |
1571 * JDK can use these bits to determine which JVM version | |
1572 * and support it has to maintain runtime compatibility. | |
1573 * | |
1574 * When a new bit is added in a minor or update release, make sure | |
1575 * the new bit is also added in the main/baseline. | |
1576 */ | |
1577 unsigned int is_attachable : 1; | |
8028 | 1578 unsigned int : 31; |
0 | 1579 unsigned int : 32; |
1580 unsigned int : 32; | |
1581 } jvm_version_info; | |
1582 | |
1583 #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) | |
1584 #define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) | |
1585 // Micro version is 0 in HotSpot Express VM (set in jvm.cpp). | |
1586 #define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) | |
1587 /* Build number is available in all HotSpot Express VM builds. | |
1588 * It is defined in make/hotspot_version file. | |
1589 */ | |
1590 #define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) | |
1591 | |
1592 JNIEXPORT void JNICALL | |
1593 JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); | |
1594 | |
1595 typedef struct { | |
1596 // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx | |
1597 unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */ | |
1598 /* and build number (xx) */ | |
1599 unsigned int update_version : 8; /* Update release version (uu) */ | |
1600 unsigned int special_update_version : 8; /* Special update release version (c)*/ | |
1601 unsigned int reserved1 : 16; | |
1602 unsigned int reserved2; | |
1603 | |
1604 /* The following bits represents new JDK supports that VM has dependency on. | |
1605 * VM implementation can use these bits to determine which JDK version | |
1606 * and support it has to maintain runtime compatibility. | |
1607 * | |
1608 * When a new bit is added in a minor or update release, make sure | |
1609 * the new bit is also added in the main/baseline. | |
1610 */ | |
1611 unsigned int thread_park_blocker : 1; | |
2129
8f8dfba37802
6994753: Implement optional hook to a Java method at VM startup.
kevinw
parents:
2014
diff
changeset
|
1612 unsigned int post_vm_init_hook_enabled : 1; |
3917
eca1193ca245
4965777: GC changes to support use of discovered field for pending references
ysr
parents:
2460
diff
changeset
|
1613 unsigned int pending_list_uses_discovered_field : 1; |
eca1193ca245
4965777: GC changes to support use of discovered field for pending references
ysr
parents:
2460
diff
changeset
|
1614 unsigned int : 29; |
0 | 1615 unsigned int : 32; |
1616 unsigned int : 32; | |
1617 } jdk_version_info; | |
1618 | |
1619 #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) | |
1620 #define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) | |
1621 #define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) | |
1622 | |
1623 /* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN) | |
1624 * It will be zero for internal builds. | |
1625 */ | |
1626 #define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) | |
1627 | |
1628 /* | |
1629 * This is the function JDK_GetVersionInfo0 defined in libjava.so | |
1630 * that is dynamically looked up by JVM. | |
1631 */ | |
1632 typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); | |
1633 | |
1634 /* | |
1635 * This structure is used by the launcher to get the default thread | |
1636 * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a | |
1637 * version of 1.1. As it is not supported otherwise, it has been removed | |
1638 * from jni.h | |
1639 */ | |
1640 typedef struct JDK1_1InitArgs { | |
1641 jint version; | |
1642 | |
1643 char **properties; | |
1644 jint checkSource; | |
1645 jint nativeStackSize; | |
1646 jint javaStackSize; | |
1647 jint minHeapSize; | |
1648 jint maxHeapSize; | |
1649 jint verifyMode; | |
1650 char *classpath; | |
1651 | |
1652 jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); | |
1653 void (JNICALL *exit)(jint code); | |
1654 void (JNICALL *abort)(void); | |
1655 | |
1656 jint enableClassGC; | |
1657 jint enableVerboseGC; | |
1658 jint disableAsyncGC; | |
1659 jint verbose; | |
1660 jboolean debugging; | |
1661 jint debugPort; | |
1662 } JDK1_1InitArgs; | |
1663 | |
1664 #ifdef __cplusplus | |
1665 } /* extern "C" */ | |
1666 #endif /* __cplusplus */ | |
1667 | |
1668 #endif /* !_JAVASOFT_JVM_H_ */ | |
1972 | 1669 |
1670 #endif // SHARE_VM_PRIMS_JVM_H |