< prev index next >

src/hotspot/share/oops/klass.hpp

Print this page

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


167 private:
168   // This is an index into FileMapHeader::_shared_path_table[], to
169   // associate this class with the JAR file where it's loaded from during
170   // dump time. If a class is not loaded from the shared archive, this field is
171   // -1.
172   jshort _shared_class_path_index;
173 
174 #if INCLUDE_CDS
175   // Flags of the current shared class.
176   u2     _shared_class_flags;
177   enum {
178     _archived_lambda_proxy_is_available    = 1 << 1,
179     _has_value_based_class_annotation      = 1 << 2,
180     _verified_at_dump_time                 = 1 << 3,
181     _has_archived_enum_objs                = 1 << 4,
182     _regenerated                           = 1 << 5
183   };
184 #endif
185 
186   CDS_JAVA_HEAP_ONLY(int _archived_mirror_index;)

642   bool has_finalizer() const            { return _access_flags.has_finalizer(); }
643   bool has_final_method() const         { return _access_flags.has_final_method(); }
644   void set_has_finalizer()              { _access_flags.set_has_finalizer(); }
645   void set_has_final_method()           { _access_flags.set_has_final_method(); }
646   bool has_vanilla_constructor() const  { return _access_flags.has_vanilla_constructor(); }
647   void set_has_vanilla_constructor()    { _access_flags.set_has_vanilla_constructor(); }
648   bool has_miranda_methods () const     { return access_flags().has_miranda_methods(); }
649   void set_has_miranda_methods()        { _access_flags.set_has_miranda_methods(); }
650   bool is_shared() const                { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
651   void set_is_shared()                  { _access_flags.set_is_shared_class(); }
652   bool is_hidden() const                { return access_flags().is_hidden_class(); }
653   void set_is_hidden()                  { _access_flags.set_is_hidden_class(); }
654   bool is_value_based()                 { return _access_flags.is_value_based_class(); }
655   void set_is_value_based()             { _access_flags.set_is_value_based_class(); }
656 
657   inline bool is_non_strong_hidden() const;
658 
659   bool is_cloneable() const;
660   void set_is_cloneable();
661 




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

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

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