8003421: NPG: Move oops out of InstanceKlass into mirror

Inject protection_domain, signers, init_lock into java_lang_Class

Reviewed-by: stefank, dholmes, sla
This commit is contained in:
Coleen Phillimore 2013-05-22 14:37:49 -04:00
parent a1b903879f
commit 6ed8c8fcea
18 changed files with 130 additions and 136 deletions

View file

@ -58,8 +58,6 @@
// [fields ]
// [constants ]
// [class loader ]
// [protection domain ]
// [signers ]
// [source file name ]
// [inner classes ]
// [static field size ]
@ -180,16 +178,6 @@ class InstanceKlass: public Klass {
static volatile int _total_instanceKlass_count;
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 _init_lock;
// Annotations for this class
Annotations* _annotations;
// Array classes holding elements of this class.
@ -527,8 +515,10 @@ class InstanceKlass: public Klass {
void set_constants(ConstantPool* c) { _constants = c; }
// protection domain
oop protection_domain() { return _protection_domain; }
void set_protection_domain(oop pd) { klass_oop_store(&_protection_domain, pd); }
oop protection_domain() const;
// signers
objArrayOop signers() const;
// host class
Klass* host_klass() const {
@ -575,10 +565,6 @@ class InstanceKlass: public Klass {
}
}
// signers
objArrayOop signers() const { return _signers; }
void set_signers(objArrayOop s) { klass_oop_store((oop*)&_signers, s); }
// source file name
Symbol* source_file_name() const { return _source_file_name; }
void set_source_file_name(Symbol* n);
@ -912,8 +898,6 @@ class InstanceKlass: public Klass {
Method* method_at_itable(Klass* holder, int index, TRAPS);
// Garbage collection
virtual void oops_do(OopClosure* cl);
void oop_follow_contents(oop obj);
int oop_adjust_pointers(oop obj);
@ -999,14 +983,12 @@ private:
// Lock during initialization
public:
volatile oop init_lock() const {return _init_lock; }
// 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 init_lock() const;
private:
void set_init_lock(oop value) { klass_oop_store(&_init_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_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