src/share/vm/oops/instanceKlass.hpp

Print this page




 202   // Name of source file containing this klass, NULL if not specified.
 203   Symbol*         _source_file_name;
 204   // the source debug extension for this klass, NULL if not specified.
 205   // Specified as UTF-8 string without terminating zero byte in the classfile,
 206   // it is stored in the instanceklass as a NULL-terminated UTF-8 string
 207   char*           _source_debug_extension;
 208   // Generic signature, or null if none.
 209   Symbol*         _generic_signature;
 210   // Array name derived from this class which needs unreferencing
 211   // if this class is unloaded.
 212   Symbol*         _array_name;
 213 
 214   // Number of heapOopSize words used by non-static fields in this klass
 215   // (including inherited fields but after header_size()).
 216   int             _nonstatic_field_size;
 217   int             _static_field_size;    // number words used by static fields (oop and non-oop) in this klass
 218   u2              _static_oop_field_count;// number of static oop fields in this klass
 219   u2              _java_fields_count;    // The number of declared Java fields
 220   int             _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
 221 


 222   bool            _is_marked_dependent;  // used for marking during flushing and deoptimization

 223   enum {
 224     _misc_rewritten            = 1 << 0, // methods rewritten.
 225     _misc_has_nonstatic_fields = 1 << 1, // for sizing with UseCompressedOops
 226     _misc_should_verify_class  = 1 << 2, // allow caching of preverification
 227     _misc_is_anonymous         = 1 << 3  // has embedded _inner_classes field

 228   };
 229   u2              _misc_flags;
 230   u2              _minor_version;        // minor version number of class file
 231   u2              _major_version;        // major version number of class file
 232   Thread*         _init_thread;          // Pointer to current thread doing initialization (to handle recusive initialization)
 233   int             _vtable_len;           // length of Java vtable (in words)
 234   int             _itable_len;           // length of Java itable (in words)
 235   OopMapCache*    volatile _oop_map_cache;   // OopMapCache for all methods in the klass (allocated lazily)
 236   JNIid*          _jni_ids;              // First JNI identifier for static fields in this class
 237   jmethodID*      _methods_jmethod_ids;  // jmethodIDs corresponding to method_idnum, or NULL if none
 238   int*            _methods_cached_itable_indices;  // itable_index cache for JNI invoke corresponding to methods idnum, or NULL
 239   nmethodBucket*  _dependencies;         // list of dependent nmethods
 240   nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
 241   BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
 242   // Array of interesting part(s) of the previous version(s) of this
 243   // InstanceKlass. See PreviousVersionWalker below.
 244   GrowableArray<PreviousVersionNode *>* _previous_versions;
 245   // JVMTI fields can be moved to their own structure - see 6315920
 246   unsigned char * _cached_class_file_bytes;       // JVMTI: cached class file, before retransformable agent modified it in CFLH
 247   jint            _cached_class_file_len;         // JVMTI: length of above
 248   JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map;  // JVMTI: used during heap iteration
 249 
 250   // true if class, superclass, or implemented interfaces have default methods
 251   bool            _has_default_methods;
 252 
 253   volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
 254   // Method array.
 255   Array<Method*>* _methods;
 256   // Interface (Klass*s) this class declares locally to implement.
 257   Array<Klass*>* _local_interfaces;
 258   // Interface (Klass*s) this class implements transitively.
 259   Array<Klass*>* _transitive_interfaces;
 260   // Int array containing the original order of method in the class file (for JVMTI).
 261   Array<int>*     _method_ordering;
 262   // Instance and static variable information, starts with 6-tuples of shorts
 263   // [access, name index, sig index, initval index, low_offset, high_offset]
 264   // for all fields, followed by the generic signature data at the end of
 265   // the array. Only fields with generic signature attributes have the generic
 266   // signature data set in the array. The fields array looks like following:
 267   //
 268   // f1: [access, name index, sig index, initial value index, low_offset, high_offset]
 269   // f2: [access, name index, sig index, initial value index, low_offset, high_offset]
 270   //      ...
 271   // fn: [access, name index, sig index, initial value index, low_offset, high_offset]
 272   //     [generic signature index]
 273   //     [generic signature index]
 274   //     ...
 275   Array<u2>*      _fields;
 276 


 277   // Class states are defined as ClassState (see above).
 278   // Place the _init_state here to utilize the unused 2-byte after
 279   // _idnum_allocated_count.
 280   u1              _init_state;                    // state of class
 281 
 282   u1              _reference_type;                // reference type
 283 
 284   // embedded Java vtable follows here
 285   // embedded Java itables follows here
 286   // embedded static fields follows here
 287   // embedded nonstatic oop-map blocks follows here
 288   // embedded implementor of this interface follows here
 289   //   The embedded implementor only exists if the current klass is an
 290   //   iterface. The possible values of the implementor fall into following
 291   //   three cases:
 292   //     NULL: no implementor.
 293   //     A Klass* that's not itself: one implementor.
 294   //     Itsef: more than one implementors.
 295   // embedded host klass follows here
 296   //   The embedded host klass only exists in an anonymous class for


 593     return _previous_versions;
 594   }
 595 
 596   static void purge_previous_versions(InstanceKlass* ik);
 597 
 598   // JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
 599   void set_cached_class_file(unsigned char *class_file_bytes,
 600                              jint class_file_len)     { _cached_class_file_len = class_file_len;
 601                                                         _cached_class_file_bytes = class_file_bytes; }
 602   jint get_cached_class_file_len()                    { return _cached_class_file_len; }
 603   unsigned char * get_cached_class_file_bytes()       { return _cached_class_file_bytes; }
 604 
 605   // JVMTI: Support for caching of field indices, types, and offsets
 606   void set_jvmti_cached_class_field_map(JvmtiCachedClassFieldMap* descriptor) {
 607     _jvmti_cached_class_field_map = descriptor;
 608   }
 609   JvmtiCachedClassFieldMap* jvmti_cached_class_field_map() const {
 610     return _jvmti_cached_class_field_map;
 611   }
 612 
 613   bool has_default_methods() const { return _has_default_methods; }
 614   void set_has_default_methods(bool b) { _has_default_methods = b; }








 615 
 616   // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
 617   inline u2 next_method_idnum();
 618   void set_initial_method_idnum(u2 value)             { _idnum_allocated_count = value; }
 619 
 620   // generics support
 621   Symbol* generic_signature() const                   { return _generic_signature; }
 622   void set_generic_signature(Symbol* sig)             { _generic_signature = sig; }
 623 
 624   u2 enclosing_method_data(int offset);
 625   u2 enclosing_method_class_index() {
 626     return enclosing_method_data(enclosing_method_class_index_offset);
 627   }
 628   u2 enclosing_method_method_index() {
 629     return enclosing_method_data(enclosing_method_method_index_offset);
 630   }
 631   void set_enclosing_method_indices(u2 class_index,
 632                                     u2 method_index);
 633 
 634   // jmethodID support




 202   // Name of source file containing this klass, NULL if not specified.
 203   Symbol*         _source_file_name;
 204   // the source debug extension for this klass, NULL if not specified.
 205   // Specified as UTF-8 string without terminating zero byte in the classfile,
 206   // it is stored in the instanceklass as a NULL-terminated UTF-8 string
 207   char*           _source_debug_extension;
 208   // Generic signature, or null if none.
 209   Symbol*         _generic_signature;
 210   // Array name derived from this class which needs unreferencing
 211   // if this class is unloaded.
 212   Symbol*         _array_name;
 213 
 214   // Number of heapOopSize words used by non-static fields in this klass
 215   // (including inherited fields but after header_size()).
 216   int             _nonstatic_field_size;
 217   int             _static_field_size;    // number words used by static fields (oop and non-oop) in this klass
 218   u2              _static_oop_field_count;// number of static oop fields in this klass
 219   u2              _java_fields_count;    // The number of declared Java fields
 220   int             _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
 221 
 222   // _is_marked_dependent can be set concurrently, thus cannot be part of the
 223   // _misc_flags.
 224   bool            _is_marked_dependent;  // used for marking during flushing and deoptimization
 225 
 226   enum {
 227     _misc_rewritten            = 1 << 0, // methods rewritten.
 228     _misc_has_nonstatic_fields = 1 << 1, // for sizing with UseCompressedOops
 229     _misc_should_verify_class  = 1 << 2, // allow caching of preverification
 230     _misc_is_anonymous         = 1 << 3, // has embedded _inner_classes field
 231     _misc_has_default_methods  = 1 << 4  // class/superclass/implemented interfaces has default methods
 232   };
 233   u2              _misc_flags;
 234   u2              _minor_version;        // minor version number of class file
 235   u2              _major_version;        // major version number of class file
 236   Thread*         _init_thread;          // Pointer to current thread doing initialization (to handle recusive initialization)
 237   int             _vtable_len;           // length of Java vtable (in words)
 238   int             _itable_len;           // length of Java itable (in words)
 239   OopMapCache*    volatile _oop_map_cache;   // OopMapCache for all methods in the klass (allocated lazily)
 240   JNIid*          _jni_ids;              // First JNI identifier for static fields in this class
 241   jmethodID*      _methods_jmethod_ids;  // jmethodIDs corresponding to method_idnum, or NULL if none
 242   int*            _methods_cached_itable_indices;  // itable_index cache for JNI invoke corresponding to methods idnum, or NULL
 243   nmethodBucket*  _dependencies;         // list of dependent nmethods
 244   nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
 245   BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
 246   // Array of interesting part(s) of the previous version(s) of this
 247   // InstanceKlass. See PreviousVersionWalker below.
 248   GrowableArray<PreviousVersionNode *>* _previous_versions;
 249   // JVMTI fields can be moved to their own structure - see 6315920
 250   unsigned char * _cached_class_file_bytes;       // JVMTI: cached class file, before retransformable agent modified it in CFLH
 251   jint            _cached_class_file_len;         // JVMTI: length of above
 252   JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map;  // JVMTI: used during heap iteration
 253 




 254   // Method array.
 255   Array<Method*>* _methods;
 256   // Interface (Klass*s) this class declares locally to implement.
 257   Array<Klass*>* _local_interfaces;
 258   // Interface (Klass*s) this class implements transitively.
 259   Array<Klass*>* _transitive_interfaces;
 260   // Int array containing the original order of method in the class file (for JVMTI).
 261   Array<int>*     _method_ordering;
 262   // Instance and static variable information, starts with 6-tuples of shorts
 263   // [access, name index, sig index, initval index, low_offset, high_offset]
 264   // for all fields, followed by the generic signature data at the end of
 265   // the array. Only fields with generic signature attributes have the generic
 266   // signature data set in the array. The fields array looks like following:
 267   //
 268   // f1: [access, name index, sig index, initial value index, low_offset, high_offset]
 269   // f2: [access, name index, sig index, initial value index, low_offset, high_offset]
 270   //      ...
 271   // fn: [access, name index, sig index, initial value index, low_offset, high_offset]
 272   //     [generic signature index]
 273   //     [generic signature index]
 274   //     ...
 275   Array<u2>*      _fields;
 276 
 277   volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
 278 
 279   // Class states are defined as ClassState (see above).
 280   // Place the _init_state here to utilize the unused 2-byte after
 281   // _idnum_allocated_count.
 282   u1              _init_state;                    // state of class
 283 
 284   u1              _reference_type;                // reference type
 285 
 286   // embedded Java vtable follows here
 287   // embedded Java itables follows here
 288   // embedded static fields follows here
 289   // embedded nonstatic oop-map blocks follows here
 290   // embedded implementor of this interface follows here
 291   //   The embedded implementor only exists if the current klass is an
 292   //   iterface. The possible values of the implementor fall into following
 293   //   three cases:
 294   //     NULL: no implementor.
 295   //     A Klass* that's not itself: one implementor.
 296   //     Itsef: more than one implementors.
 297   // embedded host klass follows here
 298   //   The embedded host klass only exists in an anonymous class for


 595     return _previous_versions;
 596   }
 597 
 598   static void purge_previous_versions(InstanceKlass* ik);
 599 
 600   // JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
 601   void set_cached_class_file(unsigned char *class_file_bytes,
 602                              jint class_file_len)     { _cached_class_file_len = class_file_len;
 603                                                         _cached_class_file_bytes = class_file_bytes; }
 604   jint get_cached_class_file_len()                    { return _cached_class_file_len; }
 605   unsigned char * get_cached_class_file_bytes()       { return _cached_class_file_bytes; }
 606 
 607   // JVMTI: Support for caching of field indices, types, and offsets
 608   void set_jvmti_cached_class_field_map(JvmtiCachedClassFieldMap* descriptor) {
 609     _jvmti_cached_class_field_map = descriptor;
 610   }
 611   JvmtiCachedClassFieldMap* jvmti_cached_class_field_map() const {
 612     return _jvmti_cached_class_field_map;
 613   }
 614 
 615   bool has_default_methods() const {
 616     return (_misc_flags & _misc_has_default_methods) != 0;
 617   }
 618   void set_has_default_methods(bool b) {
 619     if (b) {
 620       _misc_flags |= _misc_has_default_methods;
 621     } else {
 622       _misc_flags &= ~_misc_has_default_methods;
 623     }
 624   }
 625 
 626   // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
 627   inline u2 next_method_idnum();
 628   void set_initial_method_idnum(u2 value)             { _idnum_allocated_count = value; }
 629 
 630   // generics support
 631   Symbol* generic_signature() const                   { return _generic_signature; }
 632   void set_generic_signature(Symbol* sig)             { _generic_signature = sig; }
 633 
 634   u2 enclosing_method_data(int offset);
 635   u2 enclosing_method_class_index() {
 636     return enclosing_method_data(enclosing_method_class_index_offset);
 637   }
 638   u2 enclosing_method_method_index() {
 639     return enclosing_method_data(enclosing_method_method_index_offset);
 640   }
 641   void set_enclosing_method_indices(u2 class_index,
 642                                     u2 method_index);
 643 
 644   // jmethodID support