@@ -110,15 +110,26 @@ class ConstantPool : public Metadata {
110
110
// save space on 64-bit platforms.
111
111
Array<Klass*>* _resolved_klasses;
112
112
113
+ u2 _major_version; // major version number of class file
114
+ u2 _minor_version; // minor version number of class file
115
+
116
+ // Constant pool index to the utf8 entry of the Generic signature,
117
+ // or 0 if none.
118
+ u2 _generic_signature_index;
119
+ // Constant pool index to the utf8 entry for the name of source file
120
+ // containing this klass, 0 if not specified.
121
+ u2 _source_file_name_index;
122
+
113
123
enum {
114
124
_has_preresolution = 1 , // Flags
115
125
_on_stack = 2 ,
116
126
_is_shared = 4 ,
117
127
_has_dynamic_constant = 8
118
128
};
119
129
120
- int _flags; // old fashioned bit twiddling
121
- int _length; // number of elements in the array
130
+ u2 _flags; // old fashioned bit twiddling
131
+
132
+ int _length; // number of elements in the array
122
133
123
134
union {
124
135
// set for CDS to restore resolved references
@@ -135,8 +146,8 @@ class ConstantPool : public Metadata {
135
146
136
147
void set_operands (Array<u2>* operands) { _operands = operands; }
137
148
138
- int flags () const { return _flags; }
139
- void set_flags (int f) { _flags = f; }
149
+ u2 flags () const { return _flags; }
150
+ void set_flags (u2 f) { _flags = f; }
140
151
141
152
private:
142
153
intptr_t * base () const { return (intptr_t *) (((char *) this ) + sizeof (ConstantPool)); }
@@ -189,6 +200,30 @@ class ConstantPool : public Metadata {
189
200
_flags |= _has_preresolution;
190
201
}
191
202
203
+ // minor and major version numbers of class file
204
+ u2 major_version () const { return _major_version; }
205
+ void set_major_version (u2 major_version) { _major_version = major_version; }
206
+ u2 minor_version () const { return _minor_version; }
207
+ void set_minor_version (u2 minor_version) { _minor_version = minor_version; }
208
+
209
+ // generics support
210
+ Symbol* generic_signature () const {
211
+ return (_generic_signature_index == 0 ) ?
212
+ (Symbol*)NULL : symbol_at (_generic_signature_index);
213
+ }
214
+ u2 generic_signature_index () const { return _generic_signature_index; }
215
+ void set_generic_signature_index (u2 sig_index) { _generic_signature_index = sig_index; }
216
+
217
+ // source file name
218
+ Symbol* source_file_name () const {
219
+ return (_source_file_name_index == 0 ) ?
220
+ (Symbol*)NULL : symbol_at (_source_file_name_index);
221
+ }
222
+ u2 source_file_name_index () const { return _source_file_name_index; }
223
+ void set_source_file_name_index (u2 sourcefile_index) { _source_file_name_index = sourcefile_index; }
224
+
225
+ void copy_fields (const ConstantPool* orig);
226
+
192
227
// Redefine classes support. If a method refering to this constant pool
193
228
// is on the executing stack, or as a handle in vm code, this constant pool
194
229
// can't be removed from the set of previous versions saved in the instance
0 commit comments