< prev index next >

src/share/vm/runtime/fieldDescriptor.hpp

Print this page

        

*** 38,72 **** class fieldDescriptor VALUE_OBJ_CLASS_SPEC { private: AccessFlags _access_flags; int _index; // the field index constantPoolHandle _cp; // update the access_flags for the field in the klass void update_klass_field_access_flag() { InstanceKlass* ik = field_holder(); ik->field(index())->set_access_flags(_access_flags.as_short()); } FieldInfo* field() const { InstanceKlass* ik = field_holder(); return ik->field(_index); } public: fieldDescriptor() { DEBUG_ONLY(_index = badInt); } fieldDescriptor(InstanceKlass* ik, int index) { DEBUG_ONLY(_index = badInt); reinitialize(ik, index); } Symbol* name() const { ! return field()->name(_cp); } Symbol* signature() const { ! return field()->signature(_cp); } InstanceKlass* field_holder() const { return _cp->pool_holder(); } ConstantPool* constants() const { return _cp(); } AccessFlags access_flags() const { return _access_flags; } oop loader() const; --- 38,115 ---- class fieldDescriptor VALUE_OBJ_CLASS_SPEC { private: 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(); ik->field(index())->set_access_flags(_access_flags.as_short()); } FieldInfo* field() const { + 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 _is_accessor ? constants()->symbol_at(_field_name_from_accessor) : field()->name(_cp); } Symbol* signature() const { ! return _is_accessor ? _sig_for_accessor : field()->signature(_cp); } InstanceKlass* field_holder() const { return _cp->pool_holder(); } ConstantPool* constants() const { return _cp(); } AccessFlags access_flags() const { return _access_flags; } oop loader() const;
*** 118,127 **** --- 161,171 ---- update_klass_field_access_flag(); } // Initialization void reinitialize(InstanceKlass* ik, int index); + void reinitialize_accessor(InstanceKlass* ik); // Print void print() { print_on(tty); } void print_on(outputStream* st) const PRODUCT_RETURN; void print_on_for(outputStream* st, oop obj) PRODUCT_RETURN;
< prev index next >