comparison src/share/vm/oops/instanceKlass.hpp @ 10152:c115fac239eb

8008962: NPG: Memory regression: One extra Monitor per ConstantPool Summary: Re-use InstanceKlass::_init_lock locking ConstantPool as well. Reviewed-by: dholmes, coleenp, acorn
author iklam
date Thu, 25 Apr 2013 12:55:49 -0700
parents d587a5c30bd8
children 92ef81e2f571
comparison
equal deleted inserted replaced
10151:15a99ca4ee34 10152:c115fac239eb
182 protected: 182 protected:
183 // Protection domain. 183 // Protection domain.
184 oop _protection_domain; 184 oop _protection_domain;
185 // Class signers. 185 // Class signers.
186 objArrayOop _signers; 186 objArrayOop _signers;
187 // Initialization lock. Must be one per class and it has to be a VM internal 187 // Lock for (1) initialization; (2) access to the ConstantPool of this class.
188 // object so java code cannot lock it (like the mirror) 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).
189 // It has to be an object not a Mutex because it's held through java calls. 190 // It has to be an object not a Mutex because it's held through java calls.
190 volatile oop _init_lock; 191 volatile oop _init_lock;
191 192
192 // Annotations for this class 193 // Annotations for this class
193 Annotations* _annotations; 194 Annotations* _annotations;
968 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) 969 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
969 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) 970 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
970 #endif // INCLUDE_ALL_GCS 971 #endif // INCLUDE_ALL_GCS
971 972
972 u2 idnum_allocated_count() const { return _idnum_allocated_count; } 973 u2 idnum_allocated_count() const { return _idnum_allocated_count; }
974
973 private: 975 private:
974 // initialization state 976 // initialization state
975 #ifdef ASSERT 977 #ifdef ASSERT
976 void set_init_state(ClassState state); 978 void set_init_state(ClassState state);
977 #else 979 #else
994 { return (int*)OrderAccess::load_ptr_acquire(&_methods_cached_itable_indices); } 996 { return (int*)OrderAccess::load_ptr_acquire(&_methods_cached_itable_indices); }
995 void release_set_methods_cached_itable_indices(int* indices) 997 void release_set_methods_cached_itable_indices(int* indices)
996 { OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); } 998 { OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); }
997 999
998 // Lock during initialization 1000 // Lock during initialization
999 volatile oop init_lock() const; 1001 public:
1000 void set_init_lock(oop value) { klass_oop_store(&_init_lock, value); } 1002 volatile oop init_lock() const {return _init_lock; }
1001 void fence_and_clear_init_lock(); // after fully_initialized 1003 private:
1004 void set_init_lock(oop value) { klass_oop_store(&_init_lock, value); }
1002 1005
1003 // Offsets for memory management 1006 // Offsets for memory management
1004 oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;} 1007 oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;}
1005 oop* adr_signers() const { return (oop*)&this->_signers;} 1008 oop* adr_signers() const { return (oop*)&this->_signers;}
1006 oop* adr_init_lock() const { return (oop*)&this->_init_lock;} 1009 oop* adr_init_lock() const { return (oop*)&this->_init_lock;}