./src/share/vm/oops/instanceKlass.hpp
Print this page
rev 4331 : review #1
*** 181,194 ****
protected:
// Protection domain.
oop _protection_domain;
// Class signers.
objArrayOop _signers;
! // Initialization lock. Must be one per class and it has to be a VM internal
! // object so java code cannot lock it (like the mirror)
// It has to be an object not a Mutex because it's held through java calls.
! volatile oop _init_lock;
// Annotations for this class
Annotations* _annotations;
// Array classes holding elements of this class.
Klass* _array_klasses;
--- 181,195 ----
protected:
// Protection domain.
oop _protection_domain;
// Class signers.
objArrayOop _signers;
! // Lock for (1) initialization; (2) access to the ConstantPool of this class.
! // Must be one per class and it has to be a VM internal object so java code
! // cannot lock it (like the mirror).
// It has to be an object not a Mutex because it's held through java calls.
! volatile oop _per_class_lock;
// Annotations for this class
Annotations* _annotations;
// Array classes holding elements of this class.
Klass* _array_klasses;
*** 964,973 ****
--- 965,977 ----
ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
#endif // INCLUDE_ALL_GCS
u2 idnum_allocated_count() const { return _idnum_allocated_count; }
+
+ oop cp_lock() const { return _per_class_lock; }
+
private:
// initialization state
#ifdef ASSERT
void set_init_state(ClassState state);
#else
*** 990,1007 ****
{ return (int*)OrderAccess::load_ptr_acquire(&_methods_cached_itable_indices); }
void release_set_methods_cached_itable_indices(int* indices)
{ OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); }
// Lock during initialization
! volatile oop init_lock() const;
! void set_init_lock(oop value) { klass_oop_store(&_init_lock, value); }
! void fence_and_clear_init_lock(); // after fully_initialized
// Offsets for memory management
oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;}
oop* adr_signers() const { return (oop*)&this->_signers;}
! oop* adr_init_lock() const { return (oop*)&this->_init_lock;}
// Static methods that are used to implement member methods where an exposed this pointer
// is needed due to possible GCs
static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);
static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);
--- 994,1010 ----
{ return (int*)OrderAccess::load_ptr_acquire(&_methods_cached_itable_indices); }
void release_set_methods_cached_itable_indices(int* indices)
{ OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); }
// Lock during initialization
! volatile oop init_lock() const {return _per_class_lock; }
! void set_per_class_lock(oop value) { klass_oop_store(&_per_class_lock, value); }
// Offsets for memory management
oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;}
oop* adr_signers() const { return (oop*)&this->_signers;}
! oop* adr_per_class_lock() const { return (oop*)&this->_per_class_lock;}
// Static methods that are used to implement member methods where an exposed this pointer
// is needed due to possible GCs
static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);
static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);