42 AccessFlags _access_flags; |
42 AccessFlags _access_flags; |
43 int _index; // the field index |
43 int _index; // the field index |
44 constantPoolHandle _cp; |
44 constantPoolHandle _cp; |
45 |
45 |
46 // update the access_flags for the field in the klass |
46 // update the access_flags for the field in the klass |
47 void update_klass_field_access_flag() { |
47 inline void update_klass_field_access_flag(); |
48 InstanceKlass* ik = field_holder(); |
|
49 ik->field(index())->set_access_flags(_access_flags.as_short()); |
|
50 } |
|
51 |
48 |
52 FieldInfo* field() const { |
49 inline FieldInfo* field() const; |
53 InstanceKlass* ik = field_holder(); |
|
54 return ik->field(_index); |
|
55 } |
|
56 |
50 |
57 public: |
51 public: |
58 fieldDescriptor() { |
52 fieldDescriptor() { |
59 DEBUG_ONLY(_index = badInt); |
53 DEBUG_ONLY(_index = badInt); |
60 } |
54 } |
61 fieldDescriptor(InstanceKlass* ik, int index) { |
55 fieldDescriptor(InstanceKlass* ik, int index) { |
62 DEBUG_ONLY(_index = badInt); |
56 DEBUG_ONLY(_index = badInt); |
63 reinitialize(ik, index); |
57 reinitialize(ik, index); |
64 } |
58 } |
65 Symbol* name() const { |
59 inline Symbol* name() const; |
66 return field()->name(_cp()); |
60 inline Symbol* signature() const; |
67 } |
61 inline InstanceKlass* field_holder() const; |
68 Symbol* signature() const { |
62 inline ConstantPool* constants() const; |
69 return field()->signature(_cp()); |
63 |
70 } |
|
71 InstanceKlass* field_holder() const { return _cp->pool_holder(); } |
|
72 ConstantPool* constants() const { return _cp(); } |
|
73 AccessFlags access_flags() const { return _access_flags; } |
64 AccessFlags access_flags() const { return _access_flags; } |
74 oop loader() const; |
65 oop loader() const; |
75 // Offset (in words) of field from start of instanceOop / Klass* |
66 // Offset (in words) of field from start of instanceOop / Klass* |
76 int offset() const { return field()->offset(); } |
67 inline int offset() const; |
77 Symbol* generic_signature() const; |
68 Symbol* generic_signature() const; |
78 int index() const { return _index; } |
69 int index() const { return _index; } |
79 AnnotationArray* annotations() const; |
70 AnnotationArray* annotations() const; |
80 AnnotationArray* type_annotations() const; |
71 AnnotationArray* type_annotations() const; |
81 |
72 |
82 // Initial field value |
73 // Initial field value |
83 bool has_initial_value() const { return field()->initval_index() != 0; } |
74 inline bool has_initial_value() const; |
84 int initial_value_index() const { return field()->initval_index(); } |
75 inline int initial_value_index() const; |
85 constantTag initial_value_tag() const; // The tag will return true on one of is_int(), is_long(), is_single(), is_double() |
76 constantTag initial_value_tag() const; // The tag will return true on one of is_int(), is_long(), is_single(), is_double() |
86 jint int_initial_value() const; |
77 jint int_initial_value() const; |
87 jlong long_initial_value() const; |
78 jlong long_initial_value() const; |
88 jfloat float_initial_value() const; |
79 jfloat float_initial_value() const; |
89 jdouble double_initial_value() const; |
80 jdouble double_initial_value() const; |
90 oop string_initial_value(TRAPS) const; |
81 oop string_initial_value(TRAPS) const; |
91 |
82 |
92 // Field signature type |
83 // Field signature type |
93 BasicType field_type() const { return FieldType::basic_type(signature()); } |
84 inline BasicType field_type() const; |
94 |
85 |
95 // Access flags |
86 // Access flags |
96 bool is_public() const { return access_flags().is_public(); } |
87 bool is_public() const { return access_flags().is_public(); } |
97 bool is_private() const { return access_flags().is_private(); } |
88 bool is_private() const { return access_flags().is_private(); } |
98 bool is_protected() const { return access_flags().is_protected(); } |
89 bool is_protected() const { return access_flags().is_protected(); } |
109 bool is_field_modification_watched() const |
100 bool is_field_modification_watched() const |
110 { return access_flags().is_field_modification_watched(); } |
101 { return access_flags().is_field_modification_watched(); } |
111 bool has_initialized_final_update() const { return access_flags().has_field_initialized_final_update(); } |
102 bool has_initialized_final_update() const { return access_flags().has_field_initialized_final_update(); } |
112 bool has_generic_signature() const { return access_flags().field_has_generic_signature(); } |
103 bool has_generic_signature() const { return access_flags().field_has_generic_signature(); } |
113 |
104 |
114 void set_is_field_access_watched(const bool value) { |
105 inline void set_is_field_access_watched(const bool value); |
115 _access_flags.set_is_field_access_watched(value); |
106 inline void set_is_field_modification_watched(const bool value); |
116 update_klass_field_access_flag(); |
107 inline void set_has_initialized_final_update(const bool value); |
117 } |
|
118 |
|
119 void set_is_field_modification_watched(const bool value) { |
|
120 _access_flags.set_is_field_modification_watched(value); |
|
121 update_klass_field_access_flag(); |
|
122 } |
|
123 |
|
124 void set_has_initialized_final_update(const bool value) { |
|
125 _access_flags.set_has_field_initialized_final_update(value); |
|
126 update_klass_field_access_flag(); |
|
127 } |
|
128 |
108 |
129 // Initialization |
109 // Initialization |
130 void reinitialize(InstanceKlass* ik, int index); |
110 void reinitialize(InstanceKlass* ik, int index); |
131 |
111 |
132 // Print |
112 // Print |