< prev index next >

src/hotspot/share/runtime/reflection.hpp

Print this page

 31 #include "utilities/growableArray.hpp"
 32 
 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 Reflection: public AllStatic {
 44  public:
 45   // Constants defined by java reflection api classes
 46   enum SomeConstants {
 47     PUBLIC            = 0,
 48     DECLARED          = 1,
 49     MEMBER_PUBLIC     = 0,
 50     MEMBER_DECLARED   = 1,


 51     MAX_DIM           = 255
 52   };
 53 
 54   // Results returned by verify_class_access()
 55   enum VerifyClassAccessResults {
 56     ACCESS_OK = 0,
 57     MODULE_NOT_READABLE = 1,
 58     TYPE_NOT_EXPORTED = 2,
 59     OTHER_PROBLEM = 3
 60   };
 61 
 62   // Boxing. Returns boxed value of appropriate type. Throws IllegalArgumentException.
 63   static oop box(jvalue* v, BasicType type, TRAPS);
 64   // Unboxing. Returns type code and sets value.
 65   static BasicType unbox_for_primitive(oop boxed_value, jvalue* value, TRAPS);
 66   static BasicType unbox_for_regular_object(oop boxed_value, jvalue* value);
 67 
 68   // Widening of basic types. Throws IllegalArgumentException.
 69   static void widen(jvalue* value, BasicType current_type, BasicType wide_type, TRAPS);
 70 

 31 #include "utilities/growableArray.hpp"
 32 
 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 Reflection: public AllStatic {
 44  public:
 45   // Constants defined by java reflection api classes
 46   enum SomeConstants {
 47     PUBLIC            = 0,
 48     DECLARED          = 1,
 49     MEMBER_PUBLIC     = 0,
 50     MEMBER_DECLARED   = 1,
 51     TRUSTED_FINAL     = 0x10,
 52     NULL_RESTRICTED   = 0x20,
 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 
< prev index next >