198 bool _is_marked_dependent; // used for marking during flushing and deoptimization
199 bool _has_unloaded_dependent;
200
201 enum {
202 _misc_rewritten = 1 << 0, // methods rewritten.
203 _misc_has_nonstatic_fields = 1 << 1, // for sizing with UseCompressedOops
204 _misc_should_verify_class = 1 << 2, // allow caching of preverification
205 _misc_is_anonymous = 1 << 3, // has embedded _host_klass field
206 _misc_is_contended = 1 << 4, // marked with contended annotation
207 _misc_has_default_methods = 1 << 5, // class/superclass/implemented interfaces has default methods
208 _misc_declares_default_methods = 1 << 6, // directly declares default methods (any access)
209 _misc_has_been_redefined = 1 << 7 // class has been redefined
210 };
211 u2 _misc_flags;
212 u2 _minor_version; // minor version number of class file
213 u2 _major_version; // major version number of class file
214 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
215 int _vtable_len; // length of Java vtable (in words)
216 int _itable_len; // length of Java itable (in words)
217 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
218 MemberNameTable* _member_names; // Member names
219 JNIid* _jni_ids; // First JNI identifier for static fields in this class
220 jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none
221 nmethodBucket* _dependencies; // list of dependent nmethods
222 nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class
223 BreakpointInfo* _breakpoints; // bpt lists, managed by Method*
224 // Linked instanceKlasses of previous versions
225 InstanceKlass* _previous_versions;
226 // JVMTI fields can be moved to their own structure - see 6315920
227 // JVMTI: cached class file, before retransformable agent modified it in CFLH
228 JvmtiCachedClassFileData* _cached_class_file;
229
230 volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
231
232 // Class states are defined as ClassState (see above).
233 // Place the _init_state here to utilize the unused 2-byte after
234 // _idnum_allocated_count.
235 u1 _init_state; // state of class
236 u1 _reference_type; // reference type
237
238 JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map; // JVMTI: used during heap iteration
914
915 // This bit is initialized in classFileParser.cpp.
916 // It is false under any of the following conditions:
917 // - the class is abstract (including any interface)
918 // - the class has a finalizer (if !RegisterFinalizersAtInit)
919 // - the class size is larger than FastAllocateSizeLimit
920 // - the class is java/lang/Class, which cannot be allocated directly
921 bool can_be_fastpath_allocated() const {
922 return !layout_helper_needs_slow_path(layout_helper());
923 }
924
925 // Java vtable/itable
926 klassVtable* vtable() const; // return new klassVtable wrapper
927 inline Method* method_at_vtable(int index);
928 klassItable* itable() const; // return new klassItable wrapper
929 Method* method_at_itable(Klass* holder, int index, TRAPS);
930
931 #if INCLUDE_JVMTI
932 void adjust_default_methods(Method** old_methods, Method** new_methods,
933 int methods_length, bool* trace_name_printed);
934 #endif // INCLUDE_JVMTI
935
936 // Garbage collection
937 void oop_follow_contents(oop obj);
938 int oop_adjust_pointers(oop obj);
939
940 void clean_implementors_list(BoolObjectClosure* is_alive);
941 void clean_method_data(BoolObjectClosure* is_alive);
942 void clean_dependent_nmethods();
943
944 // Explicit metaspace deallocation of fields
945 // For RedefineClasses and class file parsing errors, we need to deallocate
946 // instanceKlasses and the metadata they point to.
947 void deallocate_contents(ClassLoaderData* loader_data);
948 static void deallocate_methods(ClassLoaderData* loader_data,
949 Array<Method*>* methods);
950 void static deallocate_interfaces(ClassLoaderData* loader_data,
951 Klass* super_klass,
952 Array<Klass*>* local_interfaces,
953 Array<Klass*>* transitive_interfaces);
1050 // Returns the array class with this class as element type
1051 Klass* array_klass_impl(bool or_null, TRAPS);
1052
1053 // find a local method (returns NULL if not found)
1054 Method* find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const;
1055 static Method* find_method_impl(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
1056
1057 // Free CHeap allocated fields.
1058 void release_C_heap_structures();
1059
1060 // RedefineClasses support
1061 void link_previous_versions(InstanceKlass* pv) { _previous_versions = pv; }
1062 void mark_newly_obsolete_methods(Array<Method*>* old_methods, int emcp_method_count);
1063 public:
1064 // CDS support - remove and restore oops from metadata. Oops are not shared.
1065 virtual void remove_unshareable_info();
1066 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
1067
1068 // jvm support
1069 jint compute_modifier_flags(TRAPS) const;
1070
1071 // JSR-292 support
1072 MemberNameTable* member_names() { return _member_names; }
1073 void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
1074 void add_member_name(int index, Handle member_name);
1075 oop get_member_name(int index);
1076
1077 public:
1078 // JVMTI support
1079 jint jvmti_class_status() const;
1080
1081 public:
1082 // Printing
1083 #ifndef PRODUCT
1084 void print_on(outputStream* st) const;
1085 #endif
1086 void print_value_on(outputStream* st) const;
1087
1088 void oop_print_value_on(oop obj, outputStream* st);
1089
1090 #ifndef PRODUCT
1091 void oop_print_on (oop obj, outputStream* st);
1092
1093 void print_dependent_nmethods(bool verbose = false);
1094 bool is_dependent_nmethod(nmethod* nm);
1095 #endif
|
198 bool _is_marked_dependent; // used for marking during flushing and deoptimization
199 bool _has_unloaded_dependent;
200
201 enum {
202 _misc_rewritten = 1 << 0, // methods rewritten.
203 _misc_has_nonstatic_fields = 1 << 1, // for sizing with UseCompressedOops
204 _misc_should_verify_class = 1 << 2, // allow caching of preverification
205 _misc_is_anonymous = 1 << 3, // has embedded _host_klass field
206 _misc_is_contended = 1 << 4, // marked with contended annotation
207 _misc_has_default_methods = 1 << 5, // class/superclass/implemented interfaces has default methods
208 _misc_declares_default_methods = 1 << 6, // directly declares default methods (any access)
209 _misc_has_been_redefined = 1 << 7 // class has been redefined
210 };
211 u2 _misc_flags;
212 u2 _minor_version; // minor version number of class file
213 u2 _major_version; // major version number of class file
214 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
215 int _vtable_len; // length of Java vtable (in words)
216 int _itable_len; // length of Java itable (in words)
217 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
218 JNIid* _jni_ids; // First JNI identifier for static fields in this class
219 jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none
220 nmethodBucket* _dependencies; // list of dependent nmethods
221 nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class
222 BreakpointInfo* _breakpoints; // bpt lists, managed by Method*
223 // Linked instanceKlasses of previous versions
224 InstanceKlass* _previous_versions;
225 // JVMTI fields can be moved to their own structure - see 6315920
226 // JVMTI: cached class file, before retransformable agent modified it in CFLH
227 JvmtiCachedClassFileData* _cached_class_file;
228
229 volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
230
231 // Class states are defined as ClassState (see above).
232 // Place the _init_state here to utilize the unused 2-byte after
233 // _idnum_allocated_count.
234 u1 _init_state; // state of class
235 u1 _reference_type; // reference type
236
237 JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map; // JVMTI: used during heap iteration
913
914 // This bit is initialized in classFileParser.cpp.
915 // It is false under any of the following conditions:
916 // - the class is abstract (including any interface)
917 // - the class has a finalizer (if !RegisterFinalizersAtInit)
918 // - the class size is larger than FastAllocateSizeLimit
919 // - the class is java/lang/Class, which cannot be allocated directly
920 bool can_be_fastpath_allocated() const {
921 return !layout_helper_needs_slow_path(layout_helper());
922 }
923
924 // Java vtable/itable
925 klassVtable* vtable() const; // return new klassVtable wrapper
926 inline Method* method_at_vtable(int index);
927 klassItable* itable() const; // return new klassItable wrapper
928 Method* method_at_itable(Klass* holder, int index, TRAPS);
929
930 #if INCLUDE_JVMTI
931 void adjust_default_methods(Method** old_methods, Method** new_methods,
932 int methods_length, bool* trace_name_printed);
933 void adjust_member_name_table(Method** old_methods, Method** new_methods,
934 int methods_length, bool* trace_name_printed);
935 #endif // INCLUDE_JVMTI
936
937 // Garbage collection
938 void oop_follow_contents(oop obj);
939 int oop_adjust_pointers(oop obj);
940
941 void clean_implementors_list(BoolObjectClosure* is_alive);
942 void clean_method_data(BoolObjectClosure* is_alive);
943 void clean_dependent_nmethods();
944
945 // Explicit metaspace deallocation of fields
946 // For RedefineClasses and class file parsing errors, we need to deallocate
947 // instanceKlasses and the metadata they point to.
948 void deallocate_contents(ClassLoaderData* loader_data);
949 static void deallocate_methods(ClassLoaderData* loader_data,
950 Array<Method*>* methods);
951 void static deallocate_interfaces(ClassLoaderData* loader_data,
952 Klass* super_klass,
953 Array<Klass*>* local_interfaces,
954 Array<Klass*>* transitive_interfaces);
1051 // Returns the array class with this class as element type
1052 Klass* array_klass_impl(bool or_null, TRAPS);
1053
1054 // find a local method (returns NULL if not found)
1055 Method* find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const;
1056 static Method* find_method_impl(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
1057
1058 // Free CHeap allocated fields.
1059 void release_C_heap_structures();
1060
1061 // RedefineClasses support
1062 void link_previous_versions(InstanceKlass* pv) { _previous_versions = pv; }
1063 void mark_newly_obsolete_methods(Array<Method*>* old_methods, int emcp_method_count);
1064 public:
1065 // CDS support - remove and restore oops from metadata. Oops are not shared.
1066 virtual void remove_unshareable_info();
1067 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
1068
1069 // jvm support
1070 jint compute_modifier_flags(TRAPS) const;
1071
1072 public:
1073 // JVMTI support
1074 jint jvmti_class_status() const;
1075
1076 public:
1077 // Printing
1078 #ifndef PRODUCT
1079 void print_on(outputStream* st) const;
1080 #endif
1081 void print_value_on(outputStream* st) const;
1082
1083 void oop_print_value_on(oop obj, outputStream* st);
1084
1085 #ifndef PRODUCT
1086 void oop_print_on (oop obj, outputStream* st);
1087
1088 void print_dependent_nmethods(bool verbose = false);
1089 bool is_dependent_nmethod(nmethod* nm);
1090 #endif
|