33 // Class Reflection contains utility methods needed for implementing the
34 // reflection api.
35 //
36 // Used by functions in the JVM interface.
37 //
38 // NOTE that in JDK 1.4 most of reflection is now implemented in Java
39 // using dynamic bytecode generation. The Array class has not yet been
40 // rewritten using bytecodes; if it were, most of the rest of this
41 // class could go away, as well as a few more entry points in jvm.cpp.
42
43 class FieldStream;
44
45 class Reflection: public AllStatic {
46 public:
47 // Constants defined by java reflection api classes
48 enum SomeConstants {
49 PUBLIC = 0,
50 DECLARED = 1,
51 MEMBER_PUBLIC = 0,
52 MEMBER_DECLARED = 1,
53 MAX_DIM = 255
54 };
55
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
|
33 // Class Reflection contains utility methods needed for implementing the
34 // reflection api.
35 //
36 // Used by functions in the JVM interface.
37 //
38 // NOTE that in JDK 1.4 most of reflection is now implemented in Java
39 // using dynamic bytecode generation. The Array class has not yet been
40 // rewritten using bytecodes; if it were, most of the rest of this
41 // class could go away, as well as a few more entry points in jvm.cpp.
42
43 class FieldStream;
44
45 class Reflection: public AllStatic {
46 public:
47 // Constants defined by java reflection api classes
48 enum SomeConstants {
49 PUBLIC = 0,
50 DECLARED = 1,
51 MEMBER_PUBLIC = 0,
52 MEMBER_DECLARED = 1,
53 TRUSTED_FINAL = 0x10,
54 NULL_RESTRICTED = 0x20,
55 MAX_DIM = 255
56 };
57
58 // Results returned by verify_class_access()
59 enum VerifyClassAccessResults {
60 ACCESS_OK = 0,
61 MODULE_NOT_READABLE = 1,
62 TYPE_NOT_EXPORTED = 2,
63 OTHER_PROBLEM = 3
64 };
65
66 // Boxing. Returns boxed value of appropriate type. Throws IllegalArgumentException.
67 static oop box(jvalue* v, BasicType type, TRAPS);
68 // Unboxing. Returns type code and sets value.
69 static BasicType unbox_for_primitive(oop boxed_value, jvalue* value, TRAPS);
70 static BasicType unbox_for_regular_object(oop boxed_value, jvalue* value);
71
72 // Widening of basic types. Throws IllegalArgumentException.
73 static void widen(jvalue* value, BasicType current_type, BasicType wide_type, TRAPS);
74
|