< prev index next >

src/hotspot/share/include/jvm.h

Print this page
rev 56072 : 8230043: Lazily load libverify
Reviewed-by: hseigel, erikj, alanb


1022  */
1023 JNIEXPORT jint JNICALL
1024 JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
1025 
1026 /*
1027  * Releases the UTF string obtained from the VM.
1028  */
1029 JNIEXPORT void JNICALL
1030 JVM_ReleaseUTF(const char *utf);
1031 
1032 /*
1033  * Compare if two classes are in the same package.
1034  */
1035 JNIEXPORT jboolean JNICALL
1036 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);
1037 
1038 /* Get classfile constants */
1039 #include "classfile_constants.h"
1040 
1041 /*
1042  * A function defined by the byte-code verifier and called by the VM.
1043  * This is not a function implemented in the VM.
1044  *
1045  * Returns JNI_FALSE if verification fails. A detailed error message
1046  * will be places in msg_buf, whose length is specified by buf_len.
1047  */
1048 typedef jboolean (*verifier_fn_t)(JNIEnv *env,
1049                                   jclass cb,
1050                                   char * msg_buf,
1051                                   jint buf_len);
1052 
1053 
1054 /*
1055  * Support for a VM-independent class format checker.
1056  */
1057 typedef struct {
1058     unsigned long code;    /* byte code */
1059     unsigned long excs;    /* exceptions */
1060     unsigned long etab;    /* catch table */
1061     unsigned long lnum;    /* line number */
1062     unsigned long lvar;    /* local vars */
1063 } method_size_info;
1064 
1065 typedef struct {
1066     unsigned int constants;    /* constant pool */
1067     unsigned int fields;
1068     unsigned int methods;
1069     unsigned int interfaces;
1070     unsigned int fields2;      /* number of static 2-word fields */
1071     unsigned int innerclasses; /* # of records in InnerClasses attr */
1072 
1073     method_size_info clinit;   /* memory used in clinit */
1074     method_size_info main;     /* used everywhere else */
1075 } class_size_info;
1076 
1077 /*
1078  * Functions defined in libjava.so to perform string conversions.
1079  *
1080  */
1081 
1082 typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);
1083 
1084 typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b);
1085 
1086 /* This is the function defined in libjava.so that performs class
1087  * format checks. This functions fills in size information about
1088  * the class file and returns:
1089  *
1090  *   0: good
1091  *  -1: out of memory
1092  *  -2: bad format
1093  *  -3: unsupported version
1094  *  -4: bad class name
1095  */
1096 
1097 typedef jint (*check_format_fn_t)(char *class_name,
1098                                   unsigned char *data,
1099                                   unsigned int data_size,
1100                                   class_size_info *class_size,
1101                                   char *message_buffer,
1102                                   jint buffer_length,
1103                                   jboolean measure_only,
1104                                   jboolean check_relaxed);
1105 
1106 #define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \
1107                                         JVM_ACC_FINAL | \
1108                                         JVM_ACC_SUPER | \
1109                                         JVM_ACC_INTERFACE | \
1110                                         JVM_ACC_ABSTRACT | \
1111                                         JVM_ACC_ANNOTATION | \
1112                                         JVM_ACC_ENUM | \
1113                                         JVM_ACC_SYNTHETIC)
1114 
1115 #define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \
1116                                         JVM_ACC_PRIVATE | \
1117                                         JVM_ACC_PROTECTED | \
1118                                         JVM_ACC_STATIC | \
1119                                         JVM_ACC_FINAL | \
1120                                         JVM_ACC_VOLATILE | \
1121                                         JVM_ACC_TRANSIENT | \
1122                                         JVM_ACC_ENUM | \
1123                                         JVM_ACC_SYNTHETIC)
1124 




1022  */
1023 JNIEXPORT jint JNICALL
1024 JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
1025 
1026 /*
1027  * Releases the UTF string obtained from the VM.
1028  */
1029 JNIEXPORT void JNICALL
1030 JVM_ReleaseUTF(const char *utf);
1031 
1032 /*
1033  * Compare if two classes are in the same package.
1034  */
1035 JNIEXPORT jboolean JNICALL
1036 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);
1037 
1038 /* Get classfile constants */
1039 #include "classfile_constants.h"
1040 
1041 /*













1042  * Support for a VM-independent class format checker.
1043  */
1044 typedef struct {
1045     unsigned long code;    /* byte code */
1046     unsigned long excs;    /* exceptions */
1047     unsigned long etab;    /* catch table */
1048     unsigned long lnum;    /* line number */
1049     unsigned long lvar;    /* local vars */
1050 } method_size_info;
1051 
1052 typedef struct {
1053     unsigned int constants;    /* constant pool */
1054     unsigned int fields;
1055     unsigned int methods;
1056     unsigned int interfaces;
1057     unsigned int fields2;      /* number of static 2-word fields */
1058     unsigned int innerclasses; /* # of records in InnerClasses attr */
1059 
1060     method_size_info clinit;   /* memory used in clinit */
1061     method_size_info main;     /* used everywhere else */
1062 } class_size_info;
1063 
1064 /*
1065  * Functions defined in libjava.so to perform string conversions.
1066  *
1067  */
1068 
1069 typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);






















1070 
1071 #define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \
1072                                         JVM_ACC_FINAL | \
1073                                         JVM_ACC_SUPER | \
1074                                         JVM_ACC_INTERFACE | \
1075                                         JVM_ACC_ABSTRACT | \
1076                                         JVM_ACC_ANNOTATION | \
1077                                         JVM_ACC_ENUM | \
1078                                         JVM_ACC_SYNTHETIC)
1079 
1080 #define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \
1081                                         JVM_ACC_PRIVATE | \
1082                                         JVM_ACC_PROTECTED | \
1083                                         JVM_ACC_STATIC | \
1084                                         JVM_ACC_FINAL | \
1085                                         JVM_ACC_VOLATILE | \
1086                                         JVM_ACC_TRANSIENT | \
1087                                         JVM_ACC_ENUM | \
1088                                         JVM_ACC_SYNTHETIC)
1089 


< prev index next >