< prev index next >

src/hotspot/share/oops/klass.hpp

Print this page

142   OopHandle   _java_mirror;
143   // Superclass
144   Klass*      _super;
145   // First subclass (NULL if none); _subklass->next_sibling() is next one
146   Klass* volatile _subklass;
147   // Sibling link (or NULL); links all subklasses of a klass
148   Klass* volatile _next_sibling;
149 
150   // All klasses loaded by a class loader are chained through these links
151   Klass*      _next_link;
152 
153   // The VM's representation of the ClassLoader used to load this class.
154   // Provide access the corresponding instance java.lang.ClassLoader.
155   ClassLoaderData* _class_loader_data;
156 
157   jint        _modifier_flags;  // Processed access flags, for use by Class.getModifiers.
158   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.
159 
160   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
161 


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

622   bool has_finalizer() const            { return _access_flags.has_finalizer(); }
623   bool has_final_method() const         { return _access_flags.has_final_method(); }
624   void set_has_finalizer()              { _access_flags.set_has_finalizer(); }
625   void set_has_final_method()           { _access_flags.set_has_final_method(); }
626   bool has_vanilla_constructor() const  { return _access_flags.has_vanilla_constructor(); }
627   void set_has_vanilla_constructor()    { _access_flags.set_has_vanilla_constructor(); }
628   bool has_miranda_methods () const     { return access_flags().has_miranda_methods(); }
629   void set_has_miranda_methods()        { _access_flags.set_has_miranda_methods(); }
630   bool is_shared() const                { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
631   void set_is_shared()                  { _access_flags.set_is_shared_class(); }
632   bool is_hidden() const                { return access_flags().is_hidden_class(); }
633   void set_is_hidden()                  { _access_flags.set_is_hidden_class(); }
634   bool is_value_based()                 { return _access_flags.is_value_based_class(); }
635   void set_is_value_based()             { _access_flags.set_is_value_based_class(); }
636 
637   inline bool is_non_strong_hidden() const;
638 
639   bool is_cloneable() const;
640   void set_is_cloneable();
641 




642   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
643 
644   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
645   virtual MetaspaceObj::Type type() const { return ClassType; }
646 
647   inline bool is_loader_alive() const;
648 
649   void clean_subklass();
650 
651   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
652   static void clean_subklass_tree() {
653     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
654   }
655 
656   // Return self, except for abstract classes with exactly 1
657   // implementor.  Then return the 1 concrete implementation.
658   Klass *up_cast_abstract();
659 
660   // klass name
661   Symbol* name() const                   { return _name; }

142   OopHandle   _java_mirror;
143   // Superclass
144   Klass*      _super;
145   // First subclass (NULL if none); _subklass->next_sibling() is next one
146   Klass* volatile _subklass;
147   // Sibling link (or NULL); links all subklasses of a klass
148   Klass* volatile _next_sibling;
149 
150   // All klasses loaded by a class loader are chained through these links
151   Klass*      _next_link;
152 
153   // The VM's representation of the ClassLoader used to load this class.
154   // Provide access the corresponding instance java.lang.ClassLoader.
155   ClassLoaderData* _class_loader_data;
156 
157   jint        _modifier_flags;  // Processed access flags, for use by Class.getModifiers.
158   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.
159 
160   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
161 
162   markWord _prototype_header;   // Used to initialize objects' header
163 
164 private:
165   // This is an index into FileMapHeader::_shared_path_table[], to
166   // associate this class with the JAR file where it's loaded from during
167   // dump time. If a class is not loaded from the shared archive, this field is
168   // -1.
169   jshort _shared_class_path_index;
170 
171 #if INCLUDE_CDS
172   // Flags of the current shared class.
173   u2     _shared_class_flags;
174   enum {
175     _archived_lambda_proxy_is_available = 2,
176     _has_value_based_class_annotation = 4,
177     _verified_at_dump_time = 8
178   };
179 #endif
180 
181   CDS_JAVA_HEAP_ONLY(int _archived_mirror_index;)
182 
183 protected:

624   bool has_finalizer() const            { return _access_flags.has_finalizer(); }
625   bool has_final_method() const         { return _access_flags.has_final_method(); }
626   void set_has_finalizer()              { _access_flags.set_has_finalizer(); }
627   void set_has_final_method()           { _access_flags.set_has_final_method(); }
628   bool has_vanilla_constructor() const  { return _access_flags.has_vanilla_constructor(); }
629   void set_has_vanilla_constructor()    { _access_flags.set_has_vanilla_constructor(); }
630   bool has_miranda_methods () const     { return access_flags().has_miranda_methods(); }
631   void set_has_miranda_methods()        { _access_flags.set_has_miranda_methods(); }
632   bool is_shared() const                { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
633   void set_is_shared()                  { _access_flags.set_is_shared_class(); }
634   bool is_hidden() const                { return access_flags().is_hidden_class(); }
635   void set_is_hidden()                  { _access_flags.set_is_hidden_class(); }
636   bool is_value_based()                 { return _access_flags.is_value_based_class(); }
637   void set_is_value_based()             { _access_flags.set_is_value_based_class(); }
638 
639   inline bool is_non_strong_hidden() const;
640 
641   bool is_cloneable() const;
642   void set_is_cloneable();
643 
644   markWord prototype_header() const      { return _prototype_header; }
645   inline void set_prototype_header(markWord header);
646   static ByteSize prototype_header_offset() { return in_ByteSize(offset_of(Klass, _prototype_header)); }
647 
648   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
649 
650   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
651   virtual MetaspaceObj::Type type() const { return ClassType; }
652 
653   inline bool is_loader_alive() const;
654 
655   void clean_subklass();
656 
657   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
658   static void clean_subklass_tree() {
659     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
660   }
661 
662   // Return self, except for abstract classes with exactly 1
663   // implementor.  Then return the 1 concrete implementation.
664   Klass *up_cast_abstract();
665 
666   // klass name
667   Symbol* name() const                   { return _name; }
< prev index next >