comparison src/share/vm/prims/jvm.h @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents 436b4a3231bf
children 8b0a4867acf0
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
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"
35 #endif 34 #endif
36 #ifdef TARGET_OS_FAMILY_windows 35 #ifdef TARGET_OS_FAMILY_windows
37 # include "jvm_windows.h" 36 # include "jvm_windows.h"
38 #endif 37 #endif
38 #ifdef TARGET_OS_FAMILY_bsd
39 # include "jvm_bsd.h"
40 #endif
39 41
40 #ifndef _JAVASOFT_JVM_H_ 42 #ifndef _JAVASOFT_JVM_H_
41 #define _JAVASOFT_JVM_H_ 43 #define _JAVASOFT_JVM_H_
42 44
43 // HotSpot integration note: 45 // HotSpot integration note:
44 // 46 //
45 // This file and jvm.h used with the JDK are identical, 47 // This file and jvm.h used with the JDK are identical,
46 // except for the three includes removed below and the 48 // except for the three includes removed below
47 // SUPPORT_OLD_REFLECTION sections cut out of the JDK's jvm.h.
48 49
49 // #include <sys/stat.h> 50 // #include <sys/stat.h>
50 // #include "jni.h" 51 // #include "jni.h"
51 // #include "jvm_md.h" 52 // #include "jvm_md.h"
52 53
288 JVM_DumpAllStacks(JNIEnv *env, jclass unused); 289 JVM_DumpAllStacks(JNIEnv *env, jclass unused);
289 290
290 JNIEXPORT jobjectArray JNICALL 291 JNIEXPORT jobjectArray JNICALL
291 JVM_GetAllThreads(JNIEnv *env, jclass dummy); 292 JVM_GetAllThreads(JNIEnv *env, jclass dummy);
292 293
294 JNIEXPORT void JNICALL
295 JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name);
296
293 /* getStackTrace() and getAllStackTraces() method */ 297 /* getStackTrace() and getAllStackTraces() method */
294 JNIEXPORT jobjectArray JNICALL 298 JNIEXPORT jobjectArray JNICALL
295 JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads); 299 JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);
296 300
297 /* 301 /*
440 JNIEXPORT jclass JNICALL 444 JNIEXPORT jclass JNICALL
441 JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name, 445 JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name,
442 jobject loader, const jbyte *buf, 446 jobject loader, const jbyte *buf,
443 jsize len, jobject pd, const char *source, 447 jsize len, jobject pd, const char *source,
444 jboolean verify); 448 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 449
454 /* 450 /*
455 * Reflection support functions 451 * Reflection support functions
456 */ 452 */
457 453
1440 JVM_RawMonitorEnter(void *mon); 1436 JVM_RawMonitorEnter(void *mon);
1441 1437
1442 JNIEXPORT void JNICALL 1438 JNIEXPORT void JNICALL
1443 JVM_RawMonitorExit(void *mon); 1439 JVM_RawMonitorExit(void *mon);
1444 1440
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 /* 1441 /*
1505 * java.lang.reflect.Method 1442 * java.lang.reflect.Method
1506 */ 1443 */
1507 JNIEXPORT jobject JNICALL 1444 JNIEXPORT jobject JNICALL
1508 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0); 1445 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);
1510 /* 1447 /*
1511 * java.lang.reflect.Constructor 1448 * java.lang.reflect.Constructor
1512 */ 1449 */
1513 JNIEXPORT jobject JNICALL 1450 JNIEXPORT jobject JNICALL
1514 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0); 1451 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);
1515
1516 #endif /* SUPPORT_OLD_REFLECTION */
1517 1452
1518 /* 1453 /*
1519 * java.lang.management support 1454 * java.lang.management support
1520 */ 1455 */
1521 JNIEXPORT void* JNICALL 1456 JNIEXPORT void* JNICALL
1648 * When a new bit is added in a minor or update release, make sure 1583 * When a new bit is added in a minor or update release, make sure
1649 * the new bit is also added in the main/baseline. 1584 * the new bit is also added in the main/baseline.
1650 */ 1585 */
1651 unsigned int thread_park_blocker : 1; 1586 unsigned int thread_park_blocker : 1;
1652 unsigned int post_vm_init_hook_enabled : 1; 1587 unsigned int post_vm_init_hook_enabled : 1;
1653 unsigned int : 30; 1588 unsigned int pending_list_uses_discovered_field : 1;
1589 unsigned int : 29;
1654 unsigned int : 32; 1590 unsigned int : 32;
1655 unsigned int : 32; 1591 unsigned int : 32;
1656 } jdk_version_info; 1592 } jdk_version_info;
1657 1593
1658 #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) 1594 #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)