56 // [local interfaces ] |
56 // [local interfaces ] |
57 // [transitive interfaces ] |
57 // [transitive interfaces ] |
58 // [fields ] |
58 // [fields ] |
59 // [constants ] |
59 // [constants ] |
60 // [class loader ] |
60 // [class loader ] |
61 // [protection domain ] |
|
62 // [signers ] |
|
63 // [source file name ] |
61 // [source file name ] |
64 // [inner classes ] |
62 // [inner classes ] |
65 // [static field size ] |
63 // [static field size ] |
66 // [nonstatic field size ] |
64 // [nonstatic field size ] |
67 // [static oop fields size ] |
65 // [static oop fields size ] |
178 |
176 |
179 private: |
177 private: |
180 static volatile int _total_instanceKlass_count; |
178 static volatile int _total_instanceKlass_count; |
181 |
179 |
182 protected: |
180 protected: |
183 // Protection domain. |
|
184 oop _protection_domain; |
|
185 // Class signers. |
|
186 objArrayOop _signers; |
|
187 // Lock for (1) initialization; (2) access to the ConstantPool of this class. |
|
188 // Must be one per class and it has to be a VM internal object so java code |
|
189 // cannot lock it (like the mirror). |
|
190 // It has to be an object not a Mutex because it's held through java calls. |
|
191 volatile oop _init_lock; |
|
192 |
|
193 // Annotations for this class |
181 // Annotations for this class |
194 Annotations* _annotations; |
182 Annotations* _annotations; |
195 // Array classes holding elements of this class. |
183 // Array classes holding elements of this class. |
196 Klass* _array_klasses; |
184 Klass* _array_klasses; |
197 // Constant pool for this class. |
185 // Constant pool for this class. |
525 // constant pool |
513 // constant pool |
526 ConstantPool* constants() const { return _constants; } |
514 ConstantPool* constants() const { return _constants; } |
527 void set_constants(ConstantPool* c) { _constants = c; } |
515 void set_constants(ConstantPool* c) { _constants = c; } |
528 |
516 |
529 // protection domain |
517 // protection domain |
530 oop protection_domain() { return _protection_domain; } |
518 oop protection_domain() const; |
531 void set_protection_domain(oop pd) { klass_oop_store(&_protection_domain, pd); } |
519 |
|
520 // signers |
|
521 objArrayOop signers() const; |
532 |
522 |
533 // host class |
523 // host class |
534 Klass* host_klass() const { |
524 Klass* host_klass() const { |
535 Klass** hk = (Klass**)adr_host_klass(); |
525 Klass** hk = (Klass**)adr_host_klass(); |
536 if (hk == NULL) { |
526 if (hk == NULL) { |
572 _misc_flags |= _misc_is_contended; |
562 _misc_flags |= _misc_is_contended; |
573 } else { |
563 } else { |
574 _misc_flags &= ~_misc_is_contended; |
564 _misc_flags &= ~_misc_is_contended; |
575 } |
565 } |
576 } |
566 } |
577 |
|
578 // signers |
|
579 objArrayOop signers() const { return _signers; } |
|
580 void set_signers(objArrayOop s) { klass_oop_store((oop*)&_signers, s); } |
|
581 |
567 |
582 // source file name |
568 // source file name |
583 Symbol* source_file_name() const { return _source_file_name; } |
569 Symbol* source_file_name() const { return _source_file_name; } |
584 void set_source_file_name(Symbol* n); |
570 void set_source_file_name(Symbol* n); |
585 |
571 |
910 inline Method* method_at_vtable(int index); |
896 inline Method* method_at_vtable(int index); |
911 klassItable* itable() const; // return new klassItable wrapper |
897 klassItable* itable() const; // return new klassItable wrapper |
912 Method* method_at_itable(Klass* holder, int index, TRAPS); |
898 Method* method_at_itable(Klass* holder, int index, TRAPS); |
913 |
899 |
914 // Garbage collection |
900 // Garbage collection |
915 virtual void oops_do(OopClosure* cl); |
|
916 |
|
917 void oop_follow_contents(oop obj); |
901 void oop_follow_contents(oop obj); |
918 int oop_adjust_pointers(oop obj); |
902 int oop_adjust_pointers(oop obj); |
919 |
903 |
920 void clean_implementors_list(BoolObjectClosure* is_alive); |
904 void clean_implementors_list(BoolObjectClosure* is_alive); |
921 void clean_method_data(BoolObjectClosure* is_alive); |
905 void clean_method_data(BoolObjectClosure* is_alive); |
997 void release_set_methods_cached_itable_indices(int* indices) |
981 void release_set_methods_cached_itable_indices(int* indices) |
998 { OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); } |
982 { OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); } |
999 |
983 |
1000 // Lock during initialization |
984 // Lock during initialization |
1001 public: |
985 public: |
1002 volatile oop init_lock() const {return _init_lock; } |
986 // Lock for (1) initialization; (2) access to the ConstantPool of this class. |
|
987 // Must be one per class and it has to be a VM internal object so java code |
|
988 // cannot lock it (like the mirror). |
|
989 // It has to be an object not a Mutex because it's held through java calls. |
|
990 volatile oop init_lock() const; |
1003 private: |
991 private: |
1004 void set_init_lock(oop value) { klass_oop_store(&_init_lock, value); } |
|
1005 |
|
1006 // Offsets for memory management |
|
1007 oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;} |
|
1008 oop* adr_signers() const { return (oop*)&this->_signers;} |
|
1009 oop* adr_init_lock() const { return (oop*)&this->_init_lock;} |
|
1010 |
992 |
1011 // Static methods that are used to implement member methods where an exposed this pointer |
993 // Static methods that are used to implement member methods where an exposed this pointer |
1012 // is needed due to possible GCs |
994 // is needed due to possible GCs |
1013 static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); |
995 static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); |
1014 static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); |
996 static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); |