58 // Klass layout: 59 // [C++ vtbl ptr ] (contained in Metadata) 60 // [layout_helper ] 61 // [super_check_offset ] for fast subtype checks 62 // [name ] 63 // [secondary_super_cache] for fast subtype checks 64 // [secondary_supers ] array of 2ndary supertypes 65 // [primary_supers 0] 66 // [primary_supers 1] 67 // [primary_supers 2] 68 // ... 69 // [primary_supers 7] 70 // [java_mirror ] 71 // [super ] 72 // [subklass ] first subclass 73 // [next_sibling ] link to chain additional subklasses 74 // [next_link ] 75 // [class_loader_data] 76 // [modifier_flags] 77 // [access_flags ] 78 // [verify_count ] - not in product 79 // [alloc_count ] 80 // [last_biased_lock_bulk_revocation_time] (64 bits) 81 // [prototype_header] 82 // [biased_lock_revocation_count] 83 // [_modified_oops] 84 // [_accumulated_modified_oops] 85 // [trace_id] 86 87 88 // Forward declarations. 89 template <class T> class Array; 90 template <class T> class GrowableArray; 91 class ClassLoaderData; 92 class klassVtable; 93 class ParCompactionManager; 94 95 class Klass : public Metadata { 96 friend class VMStructs; 97 protected: 98 // note: put frequently-used fields together at start of klass structure 99 // for better cache behavior (may not make much of a difference but sure won't hurt) 100 enum { _primary_super_limit = 8 }; 101 102 // The "layout helper" is a combined descriptor of object layout. 147 Klass* _primary_supers[_primary_super_limit]; 148 // java/lang/Class instance mirroring this class 149 oop _java_mirror; 150 // Superclass 151 Klass* _super; 152 // First subclass (NULL if none); _subklass->next_sibling() is next one 153 Klass* _subklass; 154 // Sibling link (or NULL); links all subklasses of a klass 155 Klass* _next_sibling; 156 157 // All klasses loaded by a class loader are chained through these links 158 Klass* _next_link; 159 160 // The VM's representation of the ClassLoader used to load this class. 161 // Provide access the corresponding instance java.lang.ClassLoader. 162 ClassLoaderData* _class_loader_data; 163 164 jint _modifier_flags; // Processed access flags, for use by Class.getModifiers. 165 AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. 166 167 #ifndef PRODUCT 168 int _verify_count; // to avoid redundant verifies 169 #endif 170 171 juint _alloc_count; // allocation profiling support 172 173 // Biased locking implementation and statistics 174 // (the 64-bit chunk goes first, to avoid some fragmentation) 175 jlong _last_biased_lock_bulk_revocation_time; 176 markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type 177 jint _biased_lock_revocation_count; 178 179 TRACE_DEFINE_KLASS_TRACE_ID; 180 181 // Remembered sets support for the oops in the klasses. 182 jbyte _modified_oops; // Card Table Equivalent (YC/CMS support) 183 jbyte _accumulated_modified_oops; // Mod Union Equivalent (CMS support) 184 185 // Constructor 186 Klass(); 187 188 void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS); 189 190 public: 191 bool is_klass() const volatile { return true; } 192 193 // super 194 Klass* super() const { return _super; } 195 void set_super(Klass* k) { _super = k; } 196 197 // initializes _super link, _primary_supers & _secondary_supers arrays 198 void initialize_supers(Klass* k, TRAPS); | 58 // Klass layout: 59 // [C++ vtbl ptr ] (contained in Metadata) 60 // [layout_helper ] 61 // [super_check_offset ] for fast subtype checks 62 // [name ] 63 // [secondary_super_cache] for fast subtype checks 64 // [secondary_supers ] array of 2ndary supertypes 65 // [primary_supers 0] 66 // [primary_supers 1] 67 // [primary_supers 2] 68 // ... 69 // [primary_supers 7] 70 // [java_mirror ] 71 // [super ] 72 // [subklass ] first subclass 73 // [next_sibling ] link to chain additional subklasses 74 // [next_link ] 75 // [class_loader_data] 76 // [modifier_flags] 77 // [access_flags ] 78 // [last_biased_lock_bulk_revocation_time] (64 bits) 79 // [prototype_header] 80 // [biased_lock_revocation_count] 81 // [verify_count ] - not in product 82 // [alloc_count ] 83 // [_modified_oops] 84 // [_accumulated_modified_oops] 85 // [trace_id] 86 87 88 // Forward declarations. 89 template <class T> class Array; 90 template <class T> class GrowableArray; 91 class ClassLoaderData; 92 class klassVtable; 93 class ParCompactionManager; 94 95 class Klass : public Metadata { 96 friend class VMStructs; 97 protected: 98 // note: put frequently-used fields together at start of klass structure 99 // for better cache behavior (may not make much of a difference but sure won't hurt) 100 enum { _primary_super_limit = 8 }; 101 102 // The "layout helper" is a combined descriptor of object layout. 147 Klass* _primary_supers[_primary_super_limit]; 148 // java/lang/Class instance mirroring this class 149 oop _java_mirror; 150 // Superclass 151 Klass* _super; 152 // First subclass (NULL if none); _subklass->next_sibling() is next one 153 Klass* _subklass; 154 // Sibling link (or NULL); links all subklasses of a klass 155 Klass* _next_sibling; 156 157 // All klasses loaded by a class loader are chained through these links 158 Klass* _next_link; 159 160 // The VM's representation of the ClassLoader used to load this class. 161 // Provide access the corresponding instance java.lang.ClassLoader. 162 ClassLoaderData* _class_loader_data; 163 164 jint _modifier_flags; // Processed access flags, for use by Class.getModifiers. 165 AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. 166 167 // Biased locking implementation and statistics 168 // (the 64-bit chunk goes first, to avoid some fragmentation) 169 jlong _last_biased_lock_bulk_revocation_time; 170 markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type 171 jint _biased_lock_revocation_count; 172 173 #ifndef PRODUCT 174 int _verify_count; // to avoid redundant verifies 175 #endif 176 177 juint _alloc_count; // allocation profiling support 178 179 TRACE_DEFINE_KLASS_TRACE_ID; 180 181 // Remembered sets support for the oops in the klasses. 182 jbyte _modified_oops; // Card Table Equivalent (YC/CMS support) 183 jbyte _accumulated_modified_oops; // Mod Union Equivalent (CMS support) 184 185 // Constructor 186 Klass(); 187 188 void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS); 189 190 public: 191 bool is_klass() const volatile { return true; } 192 193 // super 194 Klass* super() const { return _super; } 195 void set_super(Klass* k) { _super = k; } 196 197 // initializes _super link, _primary_supers & _secondary_supers arrays 198 void initialize_supers(Klass* k, TRAPS); |