24 |
24 |
25 #ifndef SHARE_VM_PRIMS_JVM_H |
25 #ifndef SHARE_VM_PRIMS_JVM_H |
26 #define SHARE_VM_PRIMS_JVM_H |
26 #define SHARE_VM_PRIMS_JVM_H |
27 |
27 |
28 #include "prims/jni.h" |
28 #include "prims/jni.h" |
29 #include "runtime/reflectionCompat.hpp" |
|
30 #ifdef TARGET_OS_FAMILY_linux |
29 #ifdef TARGET_OS_FAMILY_linux |
31 # include "jvm_linux.h" |
30 # include "jvm_linux.h" |
32 #endif |
31 #endif |
33 #ifdef TARGET_OS_FAMILY_solaris |
32 #ifdef TARGET_OS_FAMILY_solaris |
34 # include "jvm_solaris.h" |
33 # include "jvm_solaris.h" |
41 #define _JAVASOFT_JVM_H_ |
40 #define _JAVASOFT_JVM_H_ |
42 |
41 |
43 // HotSpot integration note: |
42 // HotSpot integration note: |
44 // |
43 // |
45 // This file and jvm.h used with the JDK are identical, |
44 // This file and jvm.h used with the JDK are identical, |
46 // except for the three includes removed below and the |
45 // except for the three includes removed below |
47 // SUPPORT_OLD_REFLECTION sections cut out of the JDK's jvm.h. |
|
48 |
46 |
49 // #include <sys/stat.h> |
47 // #include <sys/stat.h> |
50 // #include "jni.h" |
48 // #include "jni.h" |
51 // #include "jvm_md.h" |
49 // #include "jvm_md.h" |
52 |
50 |
440 JNIEXPORT jclass JNICALL |
438 JNIEXPORT jclass JNICALL |
441 JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name, |
439 JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name, |
442 jobject loader, const jbyte *buf, |
440 jobject loader, const jbyte *buf, |
443 jsize len, jobject pd, const char *source, |
441 jsize len, jobject pd, const char *source, |
444 jboolean verify); |
442 jboolean verify); |
445 |
|
446 /* Define a class with a source (MLVM) */ |
|
447 JNIEXPORT jclass JNICALL |
|
448 JVM_DefineClassWithCP(JNIEnv *env, const char *name, jobject loader, |
|
449 const jbyte *buf, jsize len, jobject pd, |
|
450 const char *source, |
|
451 // same args as JVM_DefineClassWithSource to this point |
|
452 jobjectArray constants); |
|
453 |
443 |
454 /* |
444 /* |
455 * Reflection support functions |
445 * Reflection support functions |
456 */ |
446 */ |
457 |
447 |
1440 JVM_RawMonitorEnter(void *mon); |
1430 JVM_RawMonitorEnter(void *mon); |
1441 |
1431 |
1442 JNIEXPORT void JNICALL |
1432 JNIEXPORT void JNICALL |
1443 JVM_RawMonitorExit(void *mon); |
1433 JVM_RawMonitorExit(void *mon); |
1444 |
1434 |
1445 |
|
1446 #ifdef SUPPORT_OLD_REFLECTION |
|
1447 |
|
1448 /* |
|
1449 * Support for old native code-based (pre-JDK 1.4) reflection implementation. |
|
1450 * Disabled by default in the product build. |
|
1451 * |
|
1452 * See reflection.hpp for information on SUPPORT_OLD_REFLECTION |
|
1453 */ |
|
1454 |
|
1455 /* |
|
1456 * reflecting fields and methods. |
|
1457 * which: 0 --- MEMBER_PUBLIC |
|
1458 * 1 --- MEMBER_DECLARED |
|
1459 * NOTE: absent in product build by default |
|
1460 */ |
|
1461 |
|
1462 JNIEXPORT jobjectArray JNICALL |
|
1463 JVM_GetClassFields(JNIEnv *env, jclass cls, jint which); |
|
1464 |
|
1465 JNIEXPORT jobjectArray JNICALL |
|
1466 JVM_GetClassMethods(JNIEnv *env, jclass cls, jint which); |
|
1467 |
|
1468 JNIEXPORT jobjectArray JNICALL |
|
1469 JVM_GetClassConstructors(JNIEnv *env, jclass cls, jint which); |
|
1470 |
|
1471 JNIEXPORT jobject JNICALL |
|
1472 JVM_GetClassField(JNIEnv *env, jclass cls, jstring name, jint which); |
|
1473 |
|
1474 JNIEXPORT jobject JNICALL |
|
1475 JVM_GetClassMethod(JNIEnv *env, jclass cls, jstring name, jobjectArray types, |
|
1476 jint which); |
|
1477 JNIEXPORT jobject JNICALL |
|
1478 JVM_GetClassConstructor(JNIEnv *env, jclass cls, jobjectArray types, |
|
1479 jint which); |
|
1480 |
|
1481 /* |
|
1482 * Implements Class.newInstance |
|
1483 */ |
|
1484 JNIEXPORT jobject JNICALL |
|
1485 JVM_NewInstance(JNIEnv *env, jclass cls); |
|
1486 |
|
1487 /* |
|
1488 * java.lang.reflect.Field |
|
1489 */ |
|
1490 JNIEXPORT jobject JNICALL |
|
1491 JVM_GetField(JNIEnv *env, jobject field, jobject obj); |
|
1492 |
|
1493 JNIEXPORT jvalue JNICALL |
|
1494 JVM_GetPrimitiveField(JNIEnv *env, jobject field, jobject obj, |
|
1495 unsigned char wCode); |
|
1496 |
|
1497 JNIEXPORT void JNICALL |
|
1498 JVM_SetField(JNIEnv *env, jobject field, jobject obj, jobject val); |
|
1499 |
|
1500 JNIEXPORT void JNICALL |
|
1501 JVM_SetPrimitiveField(JNIEnv *env, jobject field, jobject obj, jvalue v, |
|
1502 unsigned char vCode); |
|
1503 |
|
1504 /* |
1435 /* |
1505 * java.lang.reflect.Method |
1436 * java.lang.reflect.Method |
1506 */ |
1437 */ |
1507 JNIEXPORT jobject JNICALL |
1438 JNIEXPORT jobject JNICALL |
1508 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); |
1439 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); |
1510 /* |
1441 /* |
1511 * java.lang.reflect.Constructor |
1442 * java.lang.reflect.Constructor |
1512 */ |
1443 */ |
1513 JNIEXPORT jobject JNICALL |
1444 JNIEXPORT jobject JNICALL |
1514 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); |
1445 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); |
1515 |
|
1516 #endif /* SUPPORT_OLD_REFLECTION */ |
|
1517 |
1446 |
1518 /* |
1447 /* |
1519 * java.lang.management support |
1448 * java.lang.management support |
1520 */ |
1449 */ |
1521 JNIEXPORT void* JNICALL |
1450 JNIEXPORT void* JNICALL |