< prev index next >

src/hotspot/share/oops/instanceKlass.hpp

Print this page
rev 59083 : DRAFT 8236522: NonTearable marker interface for inline classes to enforce atomicity


 274   // Start after _misc_kind field.
 275   enum {
 276     _misc_rewritten                           = 1 << 3,  // methods rewritten.
 277     _misc_has_nonstatic_fields                = 1 << 4,  // for sizing with UseCompressedOops
 278     _misc_should_verify_class                 = 1 << 5,  // allow caching of preverification
 279     _misc_is_unsafe_anonymous                 = 1 << 6,  // has embedded _unsafe_anonymous_host field
 280     _misc_is_contended                        = 1 << 7,  // marked with contended annotation
 281     _misc_has_nonstatic_concrete_methods      = 1 << 8,  // class/superclass/implemented interfaces has non-static, concrete methods
 282     _misc_declares_nonstatic_concrete_methods = 1 << 9,  // directly declares non-static, concrete methods
 283     _misc_has_been_redefined                  = 1 << 10,  // class has been redefined
 284     _misc_has_passed_fingerprint_check        = 1 << 11, // when this class was loaded, the fingerprint computed from its
 285                                                          // code source was found to be matching the value recorded by AOT.
 286     _misc_is_scratch_class                    = 1 << 12, // class is the redefined scratch class
 287     _misc_is_shared_boot_class                = 1 << 13, // defining class loader is boot class loader
 288     _misc_is_shared_platform_class            = 1 << 14, // defining class loader is platform class loader
 289     _misc_is_shared_app_class                 = 1 << 15, // defining class loader is app class loader
 290     _misc_has_resolved_methods                = 1 << 16, // resolved methods table entries added for this class
 291     _misc_is_being_redefined                  = 1 << 17, // used for locking redefinition
 292     _misc_has_contended_annotations           = 1 << 18, // has @Contended annotation
 293     _misc_has_value_fields                    = 1 << 19, // has value fields and related embedded section is not empty
 294     _misc_is_empty_value                      = 1 << 20  // empty value type


 295   };
 296   u2 loader_type_bits() {
 297     return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
 298   }
 299   u4              _misc_flags;
 300   u2              _minor_version;        // minor version number of class file
 301   u2              _major_version;        // major version number of class file
 302   Thread*         _init_thread;          // Pointer to current thread doing initialization (to handle recursive initialization)
 303   OopMapCache*    volatile _oop_map_cache;   // OopMapCache for all methods in the klass (allocated lazily)
 304   JNIid*          _jni_ids;              // First JNI identifier for static fields in this class
 305   jmethodID*      volatile _methods_jmethod_ids;  // jmethodIDs corresponding to method_idnum, or NULL if none
 306   nmethodBucket*  volatile _dep_context;          // packed DependencyContext structure
 307   uint64_t        volatile _dep_context_last_cleaned;
 308   nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
 309 #if INCLUDE_JVMTI
 310   BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
 311   // Linked instanceKlasses of previous versions
 312   InstanceKlass* _previous_versions;
 313   // JVMTI fields can be moved to their own structure - see 6315920
 314   // JVMTI: cached class file, before retransformable agent modified it in CFLH


 413   void set_has_nonstatic_fields(bool b)    {
 414     if (b) {
 415       _misc_flags |= _misc_has_nonstatic_fields;
 416     } else {
 417       _misc_flags &= ~_misc_has_nonstatic_fields;
 418     }
 419   }
 420 
 421   bool has_value_fields() const          {
 422     return (_misc_flags & _misc_has_value_fields) != 0;
 423   }
 424   void set_has_value_fields()  {
 425     _misc_flags |= _misc_has_value_fields;
 426   }
 427 
 428   bool is_empty_value() const {
 429     return (_misc_flags & _misc_is_empty_value) != 0;
 430   }
 431   void set_is_empty_value() {
 432     _misc_flags |= _misc_is_empty_value;


























 433   }
 434 
 435   // field sizes
 436   int nonstatic_field_size() const         { return _nonstatic_field_size; }
 437   void set_nonstatic_field_size(int size)  { _nonstatic_field_size = size; }
 438 
 439   int static_field_size() const            { return _static_field_size; }
 440   void set_static_field_size(int size)     { _static_field_size = size; }
 441 
 442   int static_oop_field_count() const       { return (int)_static_oop_field_count; }
 443   void set_static_oop_field_count(u2 size) { _static_oop_field_count = size; }
 444 
 445   // Java itable
 446   int  itable_length() const               { return _itable_len; }
 447   void set_itable_length(int len)          { _itable_len = len; }
 448 
 449   // array klasses
 450   Klass* array_klasses() const             { return _array_klasses; }
 451   inline Klass* array_klasses_acquire() const; // load with acquire semantics
 452   void set_array_klasses(Klass* k)         { _array_klasses = k; }




 274   // Start after _misc_kind field.
 275   enum {
 276     _misc_rewritten                           = 1 << 3,  // methods rewritten.
 277     _misc_has_nonstatic_fields                = 1 << 4,  // for sizing with UseCompressedOops
 278     _misc_should_verify_class                 = 1 << 5,  // allow caching of preverification
 279     _misc_is_unsafe_anonymous                 = 1 << 6,  // has embedded _unsafe_anonymous_host field
 280     _misc_is_contended                        = 1 << 7,  // marked with contended annotation
 281     _misc_has_nonstatic_concrete_methods      = 1 << 8,  // class/superclass/implemented interfaces has non-static, concrete methods
 282     _misc_declares_nonstatic_concrete_methods = 1 << 9,  // directly declares non-static, concrete methods
 283     _misc_has_been_redefined                  = 1 << 10,  // class has been redefined
 284     _misc_has_passed_fingerprint_check        = 1 << 11, // when this class was loaded, the fingerprint computed from its
 285                                                          // code source was found to be matching the value recorded by AOT.
 286     _misc_is_scratch_class                    = 1 << 12, // class is the redefined scratch class
 287     _misc_is_shared_boot_class                = 1 << 13, // defining class loader is boot class loader
 288     _misc_is_shared_platform_class            = 1 << 14, // defining class loader is platform class loader
 289     _misc_is_shared_app_class                 = 1 << 15, // defining class loader is app class loader
 290     _misc_has_resolved_methods                = 1 << 16, // resolved methods table entries added for this class
 291     _misc_is_being_redefined                  = 1 << 17, // used for locking redefinition
 292     _misc_has_contended_annotations           = 1 << 18, // has @Contended annotation
 293     _misc_has_value_fields                    = 1 << 19, // has value fields and related embedded section is not empty
 294     _misc_is_empty_value                      = 1 << 20, // empty value type
 295     _misc_is_naturally_atomic                 = 1 << 21, // loaded/stored in one instruction
 296     _misc_is_declared_atomic                  = 1 << 22  // implements jl.NonTearable
 297   };
 298   u2 loader_type_bits() {
 299     return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
 300   }
 301   u4              _misc_flags;
 302   u2              _minor_version;        // minor version number of class file
 303   u2              _major_version;        // major version number of class file
 304   Thread*         _init_thread;          // Pointer to current thread doing initialization (to handle recursive initialization)
 305   OopMapCache*    volatile _oop_map_cache;   // OopMapCache for all methods in the klass (allocated lazily)
 306   JNIid*          _jni_ids;              // First JNI identifier for static fields in this class
 307   jmethodID*      volatile _methods_jmethod_ids;  // jmethodIDs corresponding to method_idnum, or NULL if none
 308   nmethodBucket*  volatile _dep_context;          // packed DependencyContext structure
 309   uint64_t        volatile _dep_context_last_cleaned;
 310   nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
 311 #if INCLUDE_JVMTI
 312   BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
 313   // Linked instanceKlasses of previous versions
 314   InstanceKlass* _previous_versions;
 315   // JVMTI fields can be moved to their own structure - see 6315920
 316   // JVMTI: cached class file, before retransformable agent modified it in CFLH


 415   void set_has_nonstatic_fields(bool b)    {
 416     if (b) {
 417       _misc_flags |= _misc_has_nonstatic_fields;
 418     } else {
 419       _misc_flags &= ~_misc_has_nonstatic_fields;
 420     }
 421   }
 422 
 423   bool has_value_fields() const          {
 424     return (_misc_flags & _misc_has_value_fields) != 0;
 425   }
 426   void set_has_value_fields()  {
 427     _misc_flags |= _misc_has_value_fields;
 428   }
 429 
 430   bool is_empty_value() const {
 431     return (_misc_flags & _misc_is_empty_value) != 0;
 432   }
 433   void set_is_empty_value() {
 434     _misc_flags |= _misc_is_empty_value;
 435   }
 436 
 437   // Note:  The naturally_atomic property only applies to
 438   // inline classes; it is never true on identity classes.
 439   // The bit is placed on instanceKlass for convenience.
 440 
 441   // Query if h/w provides atomic load/store for instances.
 442   bool is_naturally_atomic() const {
 443     return (_misc_flags & _misc_is_naturally_atomic) != 0;
 444   }
 445   // Initialized in the class file parser, not changed later.
 446   void set_is_naturally_atomic() {
 447     _misc_flags |= _misc_is_naturally_atomic;
 448   }
 449 
 450   // Query if this class implements jl.NonTearable or was
 451   // mentioned in the JVM option AlwaysAtomicValueTypes.
 452   // This bit can occur anywhere, but is only significant
 453   // for inline classes *and* their super types.
 454   // It inherits from supers along with NonTearable.
 455   bool is_declared_atomic() const {
 456     return (_misc_flags & _misc_is_declared_atomic) != 0;
 457   }
 458   // Initialized in the class file parser, not changed later.
 459   void set_is_declared_atomic() {
 460     _misc_flags |= _misc_is_declared_atomic;
 461   }
 462 
 463   // field sizes
 464   int nonstatic_field_size() const         { return _nonstatic_field_size; }
 465   void set_nonstatic_field_size(int size)  { _nonstatic_field_size = size; }
 466 
 467   int static_field_size() const            { return _static_field_size; }
 468   void set_static_field_size(int size)     { _static_field_size = size; }
 469 
 470   int static_oop_field_count() const       { return (int)_static_oop_field_count; }
 471   void set_static_oop_field_count(u2 size) { _static_oop_field_count = size; }
 472 
 473   // Java itable
 474   int  itable_length() const               { return _itable_len; }
 475   void set_itable_length(int len)          { _itable_len = len; }
 476 
 477   // array klasses
 478   Klass* array_klasses() const             { return _array_klasses; }
 479   inline Klass* array_klasses_acquire() const; // load with acquire semantics
 480   void set_array_klasses(Klass* k)         { _array_klasses = k; }


< prev index next >