--- old/src/share/vm/runtime/fieldDescriptor.hpp 2015-12-05 15:20:06.998452335 +0100 +++ new/src/share/vm/runtime/fieldDescriptor.hpp 2015-12-05 15:20:06.850452331 +0100 @@ -40,7 +40,14 @@ AccessFlags _access_flags; int _index; // the field index constantPoolHandle _cp; - + u2 _putAccessor; + u2 _getAccessor; + bool _is_accessor; + u2 _field_name_from_accessor; + FieldInfo* _accessor_info; + Symbol* _sig_for_accessor; + + // update the access_flags for the field in the klass void update_klass_field_access_flag() { InstanceKlass* ik = field_holder(); @@ -48,23 +55,59 @@ } FieldInfo* field() const { - InstanceKlass* ik = field_holder(); - return ik->field(_index); + if (_is_accessor) { + return _accessor_info; + }else { + InstanceKlass* ik = field_holder(); + return ik->field(_index); + } } public: fieldDescriptor() { DEBUG_ONLY(_index = badInt); + _is_accessor = false; + _index = -1; + _accessor_info = NULL; } fieldDescriptor(InstanceKlass* ik, int index) { DEBUG_ONLY(_index = badInt); reinitialize(ik, index); } + + void set_sig_for_accessor(Symbol* sig) { + this->_sig_for_accessor = sig; + } + + void set_field_name_from_accessor(u2 field_name_from_accessor) { + this->_field_name_from_accessor = field_name_from_accessor; + } + + bool is_accessor() { + return _is_accessor; + } + + u2 get_get_accessor() { + return _getAccessor; + } + + u2 get_put_accessor() { + return _putAccessor; + } + + void set_get_accessor(u2 index) { + _getAccessor = index; + } + + void set_put_accessor(u2 index) { + _putAccessor = index; + } + Symbol* name() const { - return field()->name(_cp); + return _is_accessor ? constants()->symbol_at(_field_name_from_accessor) : field()->name(_cp); } Symbol* signature() const { - return field()->signature(_cp); + return _is_accessor ? _sig_for_accessor : field()->signature(_cp); } InstanceKlass* field_holder() const { return _cp->pool_holder(); } ConstantPool* constants() const { return _cp(); } @@ -120,6 +163,7 @@ // Initialization void reinitialize(InstanceKlass* ik, int index); + void reinitialize_accessor(InstanceKlass* ik); // Print void print() { print_on(tty); }