197 // _misc_flags.
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_has_been_redefined = 1 << 6 // class has been redefined
209 };
210 u2 _misc_flags;
211 u2 _minor_version; // minor version number of class file
212 u2 _major_version; // major version number of class file
213 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
214 int _vtable_len; // length of Java vtable (in words)
215 int _itable_len; // length of Java itable (in words)
216 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
217 MemberNameTable* _member_names; // Member names
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
901
902 // This bit is initialized in classFileParser.cpp.
903 // It is false under any of the following conditions:
904 // - the class is abstract (including any interface)
905 // - the class has a finalizer (if !RegisterFinalizersAtInit)
906 // - the class size is larger than FastAllocateSizeLimit
907 // - the class is java/lang/Class, which cannot be allocated directly
908 bool can_be_fastpath_allocated() const {
909 return !layout_helper_needs_slow_path(layout_helper());
910 }
911
912 // Java vtable/itable
913 klassVtable* vtable() const; // return new klassVtable wrapper
914 inline Method* method_at_vtable(int index);
915 klassItable* itable() const; // return new klassItable wrapper
916 Method* method_at_itable(Klass* holder, int index, TRAPS);
917
918 #if INCLUDE_JVMTI
919 void adjust_default_methods(Method** old_methods, Method** new_methods,
920 int methods_length, bool* trace_name_printed);
921 #endif // INCLUDE_JVMTI
922
923 // Garbage collection
924 void oop_follow_contents(oop obj);
925 int oop_adjust_pointers(oop obj);
926
927 void clean_implementors_list(BoolObjectClosure* is_alive);
928 void clean_method_data(BoolObjectClosure* is_alive);
929 void clean_dependent_nmethods();
930
931 // Explicit metaspace deallocation of fields
932 // For RedefineClasses and class file parsing errors, we need to deallocate
933 // instanceKlasses and the metadata they point to.
934 void deallocate_contents(ClassLoaderData* loader_data);
935 static void deallocate_methods(ClassLoaderData* loader_data,
936 Array<Method*>* methods);
937 void static deallocate_interfaces(ClassLoaderData* loader_data,
938 Klass* super_klass,
939 Array<Klass*>* local_interfaces,
940 Array<Klass*>* transitive_interfaces);
1037 Klass* array_klass_impl(bool or_null, TRAPS);
1038
1039 // find a local method (returns NULL if not found)
1040 Method* find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const;
1041 static Method* find_method_impl(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
1042
1043 // Free CHeap allocated fields.
1044 void release_C_heap_structures();
1045
1046 // RedefineClasses support
1047 void link_previous_versions(InstanceKlass* pv) { _previous_versions = pv; }
1048 void mark_newly_obsolete_methods(Array<Method*>* old_methods, int emcp_method_count);
1049 public:
1050 // CDS support - remove and restore oops from metadata. Oops are not shared.
1051 virtual void remove_unshareable_info();
1052 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
1053
1054 // jvm support
1055 jint compute_modifier_flags(TRAPS) const;
1056
1057 // JSR-292 support
1058 MemberNameTable* member_names() { return _member_names; }
1059 void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
1060 void add_member_name(int index, Handle member_name);
1061 oop get_member_name(int index);
1062
1063 public:
1064 // JVMTI support
1065 jint jvmti_class_status() const;
1066
1067 public:
1068 // Printing
1069 #ifndef PRODUCT
1070 void print_on(outputStream* st) const;
1071 #endif
1072 void print_value_on(outputStream* st) const;
1073
1074 void oop_print_value_on(oop obj, outputStream* st);
1075
1076 #ifndef PRODUCT
1077 void oop_print_on (oop obj, outputStream* st);
1078
1079 void print_dependent_nmethods(bool verbose = false);
1080 bool is_dependent_nmethod(nmethod* nm);
1081 #endif
1082
|
197 // _misc_flags.
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_has_been_redefined = 1 << 6 // class has been redefined
209 };
210 u2 _misc_flags;
211 u2 _minor_version; // minor version number of class file
212 u2 _major_version; // major version number of class file
213 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
214 int _vtable_len; // length of Java vtable (in words)
215 int _itable_len; // length of Java itable (in words)
216 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
217 JNIid* _jni_ids; // First JNI identifier for static fields in this class
218 jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none
219 nmethodBucket* _dependencies; // list of dependent nmethods
220 nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class
221 BreakpointInfo* _breakpoints; // bpt lists, managed by Method*
222 // Linked instanceKlasses of previous versions
223 InstanceKlass* _previous_versions;
224 // JVMTI fields can be moved to their own structure - see 6315920
225 // JVMTI: cached class file, before retransformable agent modified it in CFLH
226 JvmtiCachedClassFileData* _cached_class_file;
227
228 volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
229
230 // Class states are defined as ClassState (see above).
231 // Place the _init_state here to utilize the unused 2-byte after
232 // _idnum_allocated_count.
233 u1 _init_state; // state of class
234 u1 _reference_type; // reference type
235
236 JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map; // JVMTI: used during heap iteration
900
901 // This bit is initialized in classFileParser.cpp.
902 // It is false under any of the following conditions:
903 // - the class is abstract (including any interface)
904 // - the class has a finalizer (if !RegisterFinalizersAtInit)
905 // - the class size is larger than FastAllocateSizeLimit
906 // - the class is java/lang/Class, which cannot be allocated directly
907 bool can_be_fastpath_allocated() const {
908 return !layout_helper_needs_slow_path(layout_helper());
909 }
910
911 // Java vtable/itable
912 klassVtable* vtable() const; // return new klassVtable wrapper
913 inline Method* method_at_vtable(int index);
914 klassItable* itable() const; // return new klassItable wrapper
915 Method* method_at_itable(Klass* holder, int index, TRAPS);
916
917 #if INCLUDE_JVMTI
918 void adjust_default_methods(Method** old_methods, Method** new_methods,
919 int methods_length, bool* trace_name_printed);
920 void adjust_member_name_table(Method** old_methods, Method** new_methods,
921 int methods_length, bool* trace_name_printed);
922 #endif // INCLUDE_JVMTI
923
924 // Garbage collection
925 void oop_follow_contents(oop obj);
926 int oop_adjust_pointers(oop obj);
927
928 void clean_implementors_list(BoolObjectClosure* is_alive);
929 void clean_method_data(BoolObjectClosure* is_alive);
930 void clean_dependent_nmethods();
931
932 // Explicit metaspace deallocation of fields
933 // For RedefineClasses and class file parsing errors, we need to deallocate
934 // instanceKlasses and the metadata they point to.
935 void deallocate_contents(ClassLoaderData* loader_data);
936 static void deallocate_methods(ClassLoaderData* loader_data,
937 Array<Method*>* methods);
938 void static deallocate_interfaces(ClassLoaderData* loader_data,
939 Klass* super_klass,
940 Array<Klass*>* local_interfaces,
941 Array<Klass*>* transitive_interfaces);
1038 Klass* array_klass_impl(bool or_null, TRAPS);
1039
1040 // find a local method (returns NULL if not found)
1041 Method* find_method_impl(Symbol* name, Symbol* signature, bool skipping_overpass) const;
1042 static Method* find_method_impl(Array<Method*>* methods, Symbol* name, Symbol* signature, bool skipping_overpass);
1043
1044 // Free CHeap allocated fields.
1045 void release_C_heap_structures();
1046
1047 // RedefineClasses support
1048 void link_previous_versions(InstanceKlass* pv) { _previous_versions = pv; }
1049 void mark_newly_obsolete_methods(Array<Method*>* old_methods, int emcp_method_count);
1050 public:
1051 // CDS support - remove and restore oops from metadata. Oops are not shared.
1052 virtual void remove_unshareable_info();
1053 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
1054
1055 // jvm support
1056 jint compute_modifier_flags(TRAPS) const;
1057
1058 public:
1059 // JVMTI support
1060 jint jvmti_class_status() const;
1061
1062 public:
1063 // Printing
1064 #ifndef PRODUCT
1065 void print_on(outputStream* st) const;
1066 #endif
1067 void print_value_on(outputStream* st) const;
1068
1069 void oop_print_value_on(oop obj, outputStream* st);
1070
1071 #ifndef PRODUCT
1072 void oop_print_on (oop obj, outputStream* st);
1073
1074 void print_dependent_nmethods(bool verbose = false);
1075 bool is_dependent_nmethod(nmethod* nm);
1076 #endif
1077
|