56 // Results returned by verify_class_access() 57 enum VerifyClassAccessResults { 58 ACCESS_OK = 0, 59 MODULE_NOT_READABLE = 1, 60 TYPE_NOT_EXPORTED = 2, 61 OTHER_PROBLEM = 3 62 }; 63 64 // Boxing. Returns boxed value of appropriate type. Throws IllegalArgumentException. 65 static oop box(jvalue* v, BasicType type, TRAPS); 66 // Unboxing. Returns type code and sets value. 67 static BasicType unbox_for_primitive(oop boxed_value, jvalue* value, TRAPS); 68 static BasicType unbox_for_regular_object(oop boxed_value, jvalue* value); 69 70 // Widening of basic types. Throws IllegalArgumentException. 71 static void widen(jvalue* value, BasicType current_type, BasicType wide_type, TRAPS); 72 73 // Reflective array access. Returns type code. Throws ArrayIndexOutOfBoundsException. 74 static BasicType array_get(jvalue* value, arrayOop a, int index, TRAPS); 75 static void array_set(jvalue* value, arrayOop a, int index, BasicType value_type, TRAPS); 76 // Returns mirror on array element type (NULL for basic type arrays and non-arrays). 77 static oop array_component_type(oop mirror, TRAPS); 78 79 // Object creation 80 static arrayOop reflect_new_array(oop element_mirror, jint length, TRAPS); 81 static arrayOop reflect_new_multi_array(oop element_mirror, typeArrayOop dimensions, TRAPS); 82 83 // Verification 84 static VerifyClassAccessResults verify_class_access(const Klass* current_class, 85 const InstanceKlass* new_class, 86 bool classloader_only); 87 // Return an error message specific to the specified Klass*'s and result. 88 // This function must be called from within a block containing a ResourceMark. 89 static char* verify_class_access_msg(const Klass* current_class, 90 const InstanceKlass* new_class, 91 const VerifyClassAccessResults result); 92 93 static bool verify_member_access(const Klass* current_class, 94 const Klass* resolved_class, 95 const Klass* member_class, 96 AccessFlags access, 97 bool classloader_only, | 56 // Results returned by verify_class_access() 57 enum VerifyClassAccessResults { 58 ACCESS_OK = 0, 59 MODULE_NOT_READABLE = 1, 60 TYPE_NOT_EXPORTED = 2, 61 OTHER_PROBLEM = 3 62 }; 63 64 // Boxing. Returns boxed value of appropriate type. Throws IllegalArgumentException. 65 static oop box(jvalue* v, BasicType type, TRAPS); 66 // Unboxing. Returns type code and sets value. 67 static BasicType unbox_for_primitive(oop boxed_value, jvalue* value, TRAPS); 68 static BasicType unbox_for_regular_object(oop boxed_value, jvalue* value); 69 70 // Widening of basic types. Throws IllegalArgumentException. 71 static void widen(jvalue* value, BasicType current_type, BasicType wide_type, TRAPS); 72 73 // Reflective array access. Returns type code. Throws ArrayIndexOutOfBoundsException. 74 static BasicType array_get(jvalue* value, arrayOop a, int index, TRAPS); 75 static void array_set(jvalue* value, arrayOop a, int index, BasicType value_type, TRAPS); 76 77 // Object creation 78 static arrayOop reflect_new_array(oop element_mirror, jint length, TRAPS); 79 static arrayOop reflect_new_multi_array(oop element_mirror, typeArrayOop dimensions, TRAPS); 80 81 // Verification 82 static VerifyClassAccessResults verify_class_access(const Klass* current_class, 83 const InstanceKlass* new_class, 84 bool classloader_only); 85 // Return an error message specific to the specified Klass*'s and result. 86 // This function must be called from within a block containing a ResourceMark. 87 static char* verify_class_access_msg(const Klass* current_class, 88 const InstanceKlass* new_class, 89 const VerifyClassAccessResults result); 90 91 static bool verify_member_access(const Klass* current_class, 92 const Klass* resolved_class, 93 const Klass* member_class, 94 AccessFlags access, 95 bool classloader_only, |