< prev index next >

src/hotspot/share/oops/klass.hpp

Print this page

148   // First subclass (NULL if none); _subklass->next_sibling() is next one
149   Klass* volatile _subklass;
150   // Sibling link (or NULL); links all subklasses of a klass
151   Klass* volatile _next_sibling;
152 
153   // All klasses loaded by a class loader are chained through these links
154   Klass*      _next_link;
155 
156   // The VM's representation of the ClassLoader used to load this class.
157   // Provide access the corresponding instance java.lang.ClassLoader.
158   ClassLoaderData* _class_loader_data;
159 
160   int _vtable_len;              // vtable length. This field may be read very often when we
161                                 // have lots of itable dispatches (e.g., lambdas and streams).
162                                 // Keep it away from the beginning of a Klass to avoid cacheline
163                                 // contention that may happen when a nearby object is modified.
164   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.
165 
166   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
167 


168 private:
169   // This is an index into FileMapHeader::_shared_path_table[], to
170   // associate this class with the JAR file where it's loaded from during
171   // dump time. If a class is not loaded from the shared archive, this field is
172   // -1.
173   jshort _shared_class_path_index;
174 
175 #if INCLUDE_CDS
176   // Various attributes for shared classes. Should be zero for a non-shared class.
177   u2     _shared_class_flags;
178   enum CDSSharedClassFlags {
179     _archived_lambda_proxy_is_available    = 1 << 1,
180     _has_value_based_class_annotation      = 1 << 2,
181     _verified_at_dump_time                 = 1 << 3,
182     _has_archived_enum_objs                = 1 << 4,
183     // This class was not loaded from a classfile in the module image
184     // or classpath.
185     _is_generated_shared_class             = 1 << 5
186   };
187 #endif

650   bool has_finalizer() const            { return _access_flags.has_finalizer(); }
651   bool has_final_method() const         { return _access_flags.has_final_method(); }
652   void set_has_finalizer()              { _access_flags.set_has_finalizer(); }
653   void set_has_final_method()           { _access_flags.set_has_final_method(); }
654   bool has_vanilla_constructor() const  { return _access_flags.has_vanilla_constructor(); }
655   void set_has_vanilla_constructor()    { _access_flags.set_has_vanilla_constructor(); }
656   bool has_miranda_methods () const     { return access_flags().has_miranda_methods(); }
657   void set_has_miranda_methods()        { _access_flags.set_has_miranda_methods(); }
658   bool is_shared() const                { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
659   void set_is_shared()                  { _access_flags.set_is_shared_class(); }
660   bool is_hidden() const                { return access_flags().is_hidden_class(); }
661   void set_is_hidden()                  { _access_flags.set_is_hidden_class(); }
662   bool is_value_based()                 { return _access_flags.is_value_based_class(); }
663   void set_is_value_based()             { _access_flags.set_is_value_based_class(); }
664 
665   inline bool is_non_strong_hidden() const;
666 
667   bool is_cloneable() const;
668   void set_is_cloneable();
669 




670   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
671 
672   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
673   virtual MetaspaceObj::Type type() const { return ClassType; }
674 
675   inline bool is_loader_alive() const;
676 
677   void clean_subklass();
678 
679   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
680   static void clean_subklass_tree() {
681     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
682   }
683 
684   // Return self, except for abstract classes with exactly 1
685   // implementor.  Then return the 1 concrete implementation.
686   Klass *up_cast_abstract();
687 
688   // klass name
689   Symbol* name() const                   { return _name; }

148   // First subclass (NULL if none); _subklass->next_sibling() is next one
149   Klass* volatile _subklass;
150   // Sibling link (or NULL); links all subklasses of a klass
151   Klass* volatile _next_sibling;
152 
153   // All klasses loaded by a class loader are chained through these links
154   Klass*      _next_link;
155 
156   // The VM's representation of the ClassLoader used to load this class.
157   // Provide access the corresponding instance java.lang.ClassLoader.
158   ClassLoaderData* _class_loader_data;
159 
160   int _vtable_len;              // vtable length. This field may be read very often when we
161                                 // have lots of itable dispatches (e.g., lambdas and streams).
162                                 // Keep it away from the beginning of a Klass to avoid cacheline
163                                 // contention that may happen when a nearby object is modified.
164   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.
165 
166   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
167 
168   markWord _prototype_header;   // Used to initialize objects' header
169 
170 private:
171   // This is an index into FileMapHeader::_shared_path_table[], to
172   // associate this class with the JAR file where it's loaded from during
173   // dump time. If a class is not loaded from the shared archive, this field is
174   // -1.
175   jshort _shared_class_path_index;
176 
177 #if INCLUDE_CDS
178   // Various attributes for shared classes. Should be zero for a non-shared class.
179   u2     _shared_class_flags;
180   enum CDSSharedClassFlags {
181     _archived_lambda_proxy_is_available    = 1 << 1,
182     _has_value_based_class_annotation      = 1 << 2,
183     _verified_at_dump_time                 = 1 << 3,
184     _has_archived_enum_objs                = 1 << 4,
185     // This class was not loaded from a classfile in the module image
186     // or classpath.
187     _is_generated_shared_class             = 1 << 5
188   };
189 #endif

652   bool has_finalizer() const            { return _access_flags.has_finalizer(); }
653   bool has_final_method() const         { return _access_flags.has_final_method(); }
654   void set_has_finalizer()              { _access_flags.set_has_finalizer(); }
655   void set_has_final_method()           { _access_flags.set_has_final_method(); }
656   bool has_vanilla_constructor() const  { return _access_flags.has_vanilla_constructor(); }
657   void set_has_vanilla_constructor()    { _access_flags.set_has_vanilla_constructor(); }
658   bool has_miranda_methods () const     { return access_flags().has_miranda_methods(); }
659   void set_has_miranda_methods()        { _access_flags.set_has_miranda_methods(); }
660   bool is_shared() const                { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
661   void set_is_shared()                  { _access_flags.set_is_shared_class(); }
662   bool is_hidden() const                { return access_flags().is_hidden_class(); }
663   void set_is_hidden()                  { _access_flags.set_is_hidden_class(); }
664   bool is_value_based()                 { return _access_flags.is_value_based_class(); }
665   void set_is_value_based()             { _access_flags.set_is_value_based_class(); }
666 
667   inline bool is_non_strong_hidden() const;
668 
669   bool is_cloneable() const;
670   void set_is_cloneable();
671 
672   markWord prototype_header() const      { return _prototype_header; }
673   inline void set_prototype_header(markWord header);
674   static ByteSize prototype_header_offset() { return in_ByteSize(offset_of(Klass, _prototype_header)); }
675 
676   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
677 
678   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
679   virtual MetaspaceObj::Type type() const { return ClassType; }
680 
681   inline bool is_loader_alive() const;
682 
683   void clean_subklass();
684 
685   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
686   static void clean_subklass_tree() {
687     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
688   }
689 
690   // Return self, except for abstract classes with exactly 1
691   // implementor.  Then return the 1 concrete implementation.
692   Klass *up_cast_abstract();
693 
694   // klass name
695   Symbol* name() const                   { return _name; }
< prev index next >